From e262cd069f84735b8f3a763b32fb68fd675a95c4 Mon Sep 17 00:00:00 2001 From: hyunfa <1598047833@qq.com> Date: Fri, 19 Jul 2024 17:11:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=BE=E7=BD=AE=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=9C=BA=E5=88=B6=20#=20Reviewed,=20transaction=20id:=2012586?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.vue | 4 ++++ frontend/src/store/modules/platform-config.ts | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index edd9382766..ffded78aa4 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -80,6 +80,10 @@ export default class App extends Vue { } private async created() { + const localConfig = JSON.parse(localStorage.getItem('config') as string); + if (localConfig) { + PlatformConfigStore.updatePlatformConfig(localConfig) + } // 获取平台配置信息 await PlatformConfigStore.getConfig(); // 设置网页标题 diff --git a/frontend/src/store/modules/platform-config.ts b/frontend/src/store/modules/platform-config.ts index 105d4f76af..0970c9c380 100644 --- a/frontend/src/store/modules/platform-config.ts +++ b/frontend/src/store/modules/platform-config.ts @@ -8,8 +8,8 @@ import logoSrc from '@/images/logoIcon.png'; export default class PlatformConfigStore extends VuexModule { public defaults: IPlatformConfig = { bkAppCode: '', // appcode - name: '', // 站点的名称,通常显示在页面左上角,也会出现在网页title中 - nameEn: '', // 站点的名称-英文 + name: '蓝鲸节点管理', // 站点的名称,通常显示在页面左上角,也会出现在网页title中 + nameEn: 'BlueKing NodeMan', // 站点的名称-英文 appLogo: '', // 站点logo favicon: '/static/images/favicon.png', // 站点favicon helperText: '', @@ -62,8 +62,10 @@ export default class PlatformConfigStore extends VuexModule { helperText: window.i18n.t('联系BK助手'), version: window.PROJECT_CONFIG.VERSION, }); - console.log("🚀 ~ PlatformConfigStore ~ getConfig ~ config:", config) - - this.context.commit('updatePlatformConfig', config); + // 判断version + if (JSON.parse(localStorage.getItem('config') as string)?.version !== config.version ) { + this.context.commit('updatePlatformConfig', config); + localStorage.setItem('config',JSON.stringify(config)); + } } }