diff --git a/web/src/helpers/utils.js b/web/src/helpers/utils.js index 38c25045..35f20c89 100644 --- a/web/src/helpers/utils.js +++ b/web/src/helpers/utils.js @@ -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;