配置页保存功能效果优化。
parent
ce74d0b3a6
commit
f656551f06
|
@ -155,15 +155,18 @@ export default {
|
||||||
this.$api.ipc.openPath(dir + '/logs/')
|
this.$api.ipc.openPath(dir + '/logs/')
|
||||||
},
|
},
|
||||||
async applyAfter () {
|
async applyAfter () {
|
||||||
// 判断是否切换了主题
|
let reloadLazy = 10
|
||||||
if (this.config.app.theme !== this.themeBackup || this.config.app.remoteConfig.url !== this.urlBackup || this.config.app.remoteConfig.personalUrl !== this.personalUrlBackup) {
|
|
||||||
if (this.config.app.remoteConfig.url !== this.urlBackup || this.config.app.remoteConfig.personalUrl !== this.personalUrlBackup) {
|
// 判断远程配置地址是否变更过,如果是则重载远程配置并重启服务
|
||||||
await this.$api.config.downloadRemoteConfig()
|
if (this.config.app.remoteConfig.url !== this.urlBackup || this.config.app.remoteConfig.personalUrl !== this.personalUrlBackup) {
|
||||||
await this.reloadConfigAndRestart()
|
await this.$api.config.downloadRemoteConfig()
|
||||||
setTimeout(window.location.reload, 1000)
|
await this.reloadConfigAndRestart()
|
||||||
} else {
|
reloadLazy = 300
|
||||||
window.location.reload()
|
}
|
||||||
}
|
|
||||||
|
// 判断是否切换了主题,如果是,则刷新页面
|
||||||
|
if (this.config.app.theme !== this.themeBackup) {
|
||||||
|
setTimeout(() => window.location.reload(), reloadLazy)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async openExternal (url) {
|
async openExternal (url) {
|
||||||
|
|
Loading…
Reference in New Issue