事先把遍历后的内容存储到内存中,免得查找其他作者时重新获取数据

This commit is contained in:
2025-06-14 14:39:17 +08:00
parent 0317061c4d
commit 117dd2d233
2 changed files with 22 additions and 18 deletions

View File

@@ -50,7 +50,7 @@ export const getUserInfo = async () => {
export const logoutUser = () => { // 不再是 async因为它不执行异步导航
// console.log('jwt.js: logoutUser called. Clearing local storage.');
localStorage.removeItem('access_token');
localStorage.removeItem('user_id'); // 如果您也存储了user_id
localStorage.removeItem('user_id');
// 导航将由调用者(如路由守卫)处理
};