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