|
@@ -50,7 +50,7 @@ axios.interceptors.request.use(async (config) => {
|
|
if (!token && !~notLoginUrls.indexOf(config.url)) {
|
|
if (!token && !~notLoginUrls.indexOf(config.url)) {
|
|
// router.replace({ name: RouteName.login });
|
|
// router.replace({ name: RouteName.login });
|
|
let redirect = encodeURIComponent(`${window.location.origin}/mix3d/#/home/${caseId}`);
|
|
let redirect = encodeURIComponent(`${window.location.origin}/mix3d/#/home/${caseId}`);
|
|
- window.location.ref = window.location.origin + "/admin/#/login?redirect=" + redirect;
|
|
|
|
|
|
+ window.location.href = window.location.origin + "/admin/#/login?redirect=" + redirect;
|
|
throw "用户未登录";
|
|
throw "用户未登录";
|
|
}
|
|
}
|
|
config.headers.token = token;
|
|
config.headers.token = token;
|
|
@@ -98,7 +98,7 @@ const responseInterceptor = (res: AxiosResponse<any, any>) => {
|
|
) {
|
|
) {
|
|
let caseId = router.currentRoute.value?.params?.caseId
|
|
let caseId = router.currentRoute.value?.params?.caseId
|
|
let redirect = encodeURIComponent(`${window.location.origin}/mix3d/#/home/${caseId}`);
|
|
let redirect = encodeURIComponent(`${window.location.origin}/mix3d/#/home/${caseId}`);
|
|
- window.location.ref = window.location.origin + "/admin/#/login?redirect=" + redirect;
|
|
|
|
|
|
+ window.location.href = window.location.origin + "/admin/#/login?redirect=" + redirect;
|
|
// router.replace({ name: RouteName.login });
|
|
// router.replace({ name: RouteName.login });
|
|
getAuth().clear();
|
|
getAuth().clear();
|
|
}
|
|
}
|