From f656551f06efc0c12d4f5c0d078be446e8e6b257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Thu, 22 Aug 2024 13:55:43 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=A1=B5=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=95=88=E6=9E=9C=E4=BC=98=E5=8C=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/gui/src/view/pages/setting.vue | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/gui/src/view/pages/setting.vue b/packages/gui/src/view/pages/setting.vue index f1c0640..0520425 100644 --- a/packages/gui/src/view/pages/setting.vue +++ b/packages/gui/src/view/pages/setting.vue @@ -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) {