fix:修复token过期带来的问题
This commit is contained in:
@@ -6,7 +6,7 @@ import { Session } from "@/utils/storage";
|
|||||||
import useAuths from "@/hooks/useAuths";
|
import useAuths from "@/hooks/useAuths";
|
||||||
|
|
||||||
const { VITE_APP_ENV_NAME } = import.meta.env;
|
const { VITE_APP_ENV_NAME } = import.meta.env;
|
||||||
const { getToken } = useAuths();
|
const { getToken, removeToken } = useAuths();
|
||||||
|
|
||||||
const { base_url, request_timeout, pre_interface } = config;
|
const { base_url, request_timeout, pre_interface } = config;
|
||||||
export const PATH_URL = base_url[VITE_APP_ENV_NAME];
|
export const PATH_URL = base_url[VITE_APP_ENV_NAME];
|
||||||
@@ -69,6 +69,7 @@ service.interceptors.response.use(
|
|||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
removeToken();
|
||||||
router.push("/login");
|
router.push("/login");
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user