mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
修复配置文件错误丢失配置问题
This commit is contained in:
@@ -8,10 +8,10 @@ const writeJson = (data: any) => {
|
||||
}
|
||||
|
||||
const readJson = () => {
|
||||
try {
|
||||
if (fs.existsSync(configFile)) {
|
||||
const data = fs.readFileSync(configFile)
|
||||
return JSON.parse(data.toString())
|
||||
} catch (error) {
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user