refactor: pac修改

pull/67/head
xiaojunnuo 2020-12-03 16:24:17 +08:00
parent f0bda94347
commit 26d959dcc0
1 changed files with 5 additions and 1 deletions

View File

@ -42,10 +42,14 @@ const localApi = {
load () {
const settingPath = _getSettingsPath()
if (!fs.existsSync(settingPath)) {
return {}
this.save({ overwall: true })
}
const file = fs.readFileSync(settingPath)
const setting = JSON5.parse(file.toString())
if (setting && setting.installTime == null) {
setting.installTime = new Date().getTime()
this.save(setting)
}
return setting || {}
},
save (setting = {}) {