🐛fix(session): The localStorage did not clear user information after the login session expired

This commit is contained in:
Apple\Apple
2025-05-20 00:50:09 +08:00
parent c04a816e59
commit 85c40424d5

View File

@@ -95,6 +95,8 @@ export function showError(error) {
if (error.name === 'AxiosError') {
switch (error.response.status) {
case 401:
// 清除用户状态
localStorage.removeItem('user');
// toast.error('错误:未登录或登录已过期,请重新登录!', showErrorOptions);
window.location.href = '/login?expired=true';
break;