From a72a2e0f494609c57ad9a847e72fba4b92762dba Mon Sep 17 00:00:00 2001 From: xream Date: Sun, 21 Jan 2024 01:16:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E5=90=8E=E7=AB=AF=E5=8F=98=E5=8C=96=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/router/index.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 880758c17..780e6a1ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sub-store-front-end", - "version": "2.14.92", + "version": "2.14.93", "private": true, "scripts": { "dev": "vite --host", diff --git a/src/router/index.ts b/src/router/index.ts index 0896337bd..16f7e7e0d 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -236,11 +236,12 @@ router.beforeResolve(async (to, from) => { } // 路由跳转时查询环境,决定是否更新数据 if (globalStore !== null) { - useEnvApi() + const storeEnv = toRaw(globalStore.env); + if (storeEnv?.backend && storeEnv?.version) { + useEnvApi() .getEnv() .then(async res => { const envNow = res; - const storeEnv = toRaw(globalStore.env); if (envNow?.data?.status === 'success') { const backend = envNow.data.data.backend; const version = envNow.data.data.version; @@ -256,6 +257,7 @@ router.beforeResolve(async (to, from) => { } } }); + } } else { globalStore = useGlobalStore(); }