fix:修复token过期带来的问题

This commit is contained in:
Xwen
2023-12-29 09:18:18 +08:00
parent 469ec71074
commit 6270e4b101

View File

@@ -6,7 +6,7 @@ import { Session } from "@/utils/storage";
import useAuths from "@/hooks/useAuths";
const { VITE_APP_ENV_NAME } = import.meta.env;
const { getToken } = useAuths();
const { getToken, removeToken } = useAuths();
const { base_url, request_timeout, pre_interface } = config;
export const PATH_URL = base_url[VITE_APP_ENV_NAME];
@@ -69,6 +69,7 @@ service.interceptors.response.use(
cancelButtonText: "取消",
type: "warning",
}).then(() => {
removeToken();
router.push("/login");
});
return;