refactor: pac修改

pull/67/head
xiaojunnuo 2020-12-03 16:27:43 +08:00
parent 26d959dcc0
commit 15ba3e65b5
1 changed files with 5 additions and 1 deletions

View File

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