From 7981c8b76ea5708bfb75b59fcd65252e72ed72f3 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期二, 20 十月 2026 14:09:55 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_江苏商贸供销社' into dev_江苏商贸供销社

---
 src/router/guard.ts |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/router/guard.ts b/src/router/guard.ts
index 19493d5..960a44a 100644
--- a/src/router/guard.ts
+++ b/src/router/guard.ts
@@ -1,10 +1,10 @@
 import type { Router } from 'vue-router';
 
-import { LOGIN_PATH } from '../packages/constants/src';
-import { $t } from '../packages/locales/src';
-import { preferences } from '../packages/preferences/src';
-import { useAccessStore, useDictStore, useUserStore } from '../packages/stores/src';
-import { startProgress, stopProgress } from '../packages/utils/src';
+import { LOGIN_PATH } from '@vben/constants';
+import { $t } from '@vben/locales';
+import { preferences } from '@vben/preferences';
+import { useAccessStore, useDictStore, useUserStore } from '@vben/stores';
+import { startProgress, stopProgress } from '@vben/utils';
 
 import { message } from 'ant-design-vue';
 
@@ -56,12 +56,14 @@
     const dictStore = useDictStore();
 
     // 鍩烘湰璺敱锛岃繖浜涜矾鐢变笉闇�瑕佽繘鍏ユ潈闄愭嫤鎴�
-    if (coreRouteNames.includes(to.name as string)) {
+    // Personal settings are available to every signed-in account and still
+    // pass through token validation and user/menu initialization below.
+    if (to.name === 'Profile') to.meta.fullPathKey = false;
+    if (coreRouteNames.includes(to.name as string) && to.name !== 'Profile') {
       if (to.path === LOGIN_PATH && accessStore.accessToken) {
         return decodeURIComponent(
           (to.query?.redirect as string) ||
-            userStore.userInfo?.homePath ||
-            preferences.app.defaultHomePath,
+            '/analytics',
         );
       }
       return true;
@@ -132,7 +134,7 @@
     userStore.setUserRoles(userRoles);
     const redirectPath = (from.query.redirect ??
       (to.path === preferences.app.defaultHomePath
-        ? userInfo?.homePath || preferences.app.defaultHomePath
+        ? '/analytics'
         : to.fullPath)) as string;
 
     return {

--
Gitblit v1.9.3