🐛fix(session): The localStorage did not clear user information after the login session expired
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user