Skip to content

Commit

Permalink
fix: 修复首次检测后端变化逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Jan 20, 2024
1 parent e718112 commit a72a2e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store-front-end",
"version": "2.14.92",
"version": "2.14.93",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
6 changes: 4 additions & 2 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -256,6 +257,7 @@ router.beforeResolve(async (to, from) => {
}
}
});
}
} else {
globalStore = useGlobalStore();
}
Expand Down

0 comments on commit a72a2e0

Please sign in to comment.