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(); }