diff --git a/src/store/modules/user.js b/src/store/modules/user.js index f1d87e8..72ae595 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -3,6 +3,7 @@ import { getTokenKeySessionStorage, removeToken, setTokenKeySessionStorage, + clearAllUserCache, } from "@/utils/auth"; const user = { @@ -92,7 +93,9 @@ const user = { commit("SET_TOKEN", ""); commit("SET_ROLES", []); commit("SET_PERMISSIONS", []); - removeToken(); + commit("SET_USERINFO", {}); + // 清理所有用户相关的缓存数据,包括conversation_id + clearAllUserCache(); resolve(); }) .catch((error) => { @@ -105,7 +108,11 @@ const user = { FedLogOut({ commit }) { return new Promise((resolve) => { commit("SET_TOKEN", ""); - removeToken(); + commit("SET_ROLES", []); + commit("SET_PERMISSIONS", []); + commit("SET_USERINFO", {}); + // 清理所有用户相关的缓存数据,包括conversation_id + clearAllUserCache(); resolve(); }); }, diff --git a/src/utils/auth.js b/src/utils/auth.js index 34a5d8e..2fe05d8 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -23,3 +23,28 @@ export function getTokenKeySessionStorage() { export function removeToken() { return Cookies.remove(TokenKey) } + +// 清理sessionStorage中的token +export function removeTokenFromSessionStorage() { + sessionStorage.removeItem(TokenKey) +} + +// 清理AI聊天相关的localStorage数据 +export function clearAIChatCache() { + localStorage.removeItem('conversation_id') + // 可以根据需要添加其他AI聊天相关的缓存清理 +} + +// 清理所有用户相关的缓存数据 +export function clearAllUserCache() { + // 清理token相关 + removeToken() + removeTokenFromSessionStorage() + + // 清理AI聊天缓存 + clearAIChatCache() + + // 清理其他用户相关的localStorage数据 + localStorage.removeItem('userId') + localStorage.removeItem('userName') +} diff --git a/src/views/Home/comps/fdy-undo.vue b/src/views/Home/comps/fdy-undo.vue index edc392f..843a8b8 100644 --- a/src/views/Home/comps/fdy-undo.vue +++ b/src/views/Home/comps/fdy-undo.vue @@ -67,6 +67,18 @@ export default { value: 0, url: "/dormitory/stuDormitoryManage/fdys" }, + { + label: "辅导员·学生证补办审核", + name: "xszb", + value: 0, + url: "/routine/sicr/counsellorExamine" + }, + { + label: "辅导员·在校证明审核", + name: "zxzm", + value: 0, + url: "/routine/school/application" + }, { label: "辅导员·任务管理审核", @@ -199,4 +211,4 @@ export default { transform: scale(1.1); } - \ No newline at end of file + diff --git a/src/views/Home/comps/jwc-undo.vue b/src/views/Home/comps/jwc-undo.vue index 2ac6366..f4fb790 100644 --- a/src/views/Home/comps/jwc-undo.vue +++ b/src/views/Home/comps/jwc-undo.vue @@ -82,10 +82,10 @@ export default { }, // 宁博 { - label: "学工·国家励志奖学金审核", - name: "knzzgl", - value: 0, - url: "/hard/gl/xg" + label: "学工·国家励志奖学金审核", + name: "knzzgl", + value: 0, + url: "/hard/gl/xg" }, // 陈冠元 { @@ -94,6 +94,18 @@ export default { value: 0, url: "/hard/zzq/xg", }, + { + label: "学工·学生证补办审核", + name: "xszb", + value: 0, + url: "/routine/sicr/learningIndustrialProductionAudit" + }, + { + label: "学工·在校证明审核", + name: "zxzm", + value: 0, + url: "/routine/school/learning" + } ] } @@ -187,4 +199,4 @@ export default { transform: scale(1.1); } - \ No newline at end of file +