diff --git a/src/store/modules/auth/index.ts b/src/store/modules/auth/index.ts index 31c4432..d7d046a 100644 --- a/src/store/modules/auth/index.ts +++ b/src/store/modules/auth/index.ts @@ -22,7 +22,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => { const token = ref(''); const userInfo: Api.Auth.UserInfo = reactive({ - userId: '', + user_id: 0, username: '', roles: [], buttons: [] @@ -56,12 +56,12 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => { /** Record the user ID of the previous login session Used to compare with the current user ID on next login */ function recordUserId() { - if (!userInfo.userId) { + if (!userInfo.user_id) { return; } // Store current user ID locally for next login comparison - localStg.set('lastLoginUserId', userInfo.userId); + localStg.set('lastLoginUserId', String(userInfo.user_id)); } /** @@ -70,14 +70,14 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => { * @returns {boolean} Whether to clear all tabs */ function checkTabClear(): boolean { - if (!userInfo.userId) { + if (!userInfo.user_id) { return false; } const lastLoginUserId = localStg.get('lastLoginUserId'); // Clear all tabs if current user is different from previous user - if (!lastLoginUserId || lastLoginUserId !== userInfo.userId) { + if (!lastLoginUserId || lastLoginUserId !== String(userInfo.user_id)) { localStg.remove('globalTabs'); tabStore.clearTabs(); @@ -155,7 +155,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => { // 同步 AI 插件用户身份(exchange 换 ai_token 用) setAiUser({ - platform_user_id: String(info.userId), + platform_user_id: String(info.user_id), align_key: info.username, display_name: info.username }); diff --git a/src/typings/api/auth.d.ts b/src/typings/api/auth.d.ts index 93f575b..d42fa94 100644 --- a/src/typings/api/auth.d.ts +++ b/src/typings/api/auth.d.ts @@ -12,7 +12,7 @@ declare namespace Api { } interface UserInfo { - userId: string; + user_id: number; username: string; roles: string[]; buttons: string[]; diff --git a/src/views/changeLedger/modules/list.vue b/src/views/changeLedger/modules/list.vue index 381151c..6d06632 100644 --- a/src/views/changeLedger/modules/list.vue +++ b/src/views/changeLedger/modules/list.vue @@ -527,7 +527,9 @@ onMounted(async () => { -
暂无数据
+更多高风险场景与分析记录见「高风险」页
暂无高风险在办
+各车间变更数量({{dateLabel}})
暂无数据
+更多高风险场景与分析记录见「高风险」页
暂无高风险在办
+