fix: 优化登录相关权限问题 添加按键权限判断
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { auth } from '@/hooks/';
|
||||
import { auth, forceReLogin } from '@/hooks/';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
const baseUrl = import.meta.env?.VITE_API_BASE_URL || '';
|
||||
@@ -8,9 +8,7 @@ const activeControllers = new Set<AbortController>();
|
||||
|
||||
/** 统一处理 401 未授权逻辑 */
|
||||
const handleUnauthorized = (msg?: string) => {
|
||||
auth.logout();
|
||||
message.error(msg || '登录状态已过期,请重新登录');
|
||||
window.location.href = '/login';
|
||||
forceReLogin(msg || '登录状态已过期,请重新登录');
|
||||
};
|
||||
|
||||
const request = (
|
||||
|
||||
Reference in New Issue
Block a user