fix 修复 重新登录无法跳转到过期前页面问题
This commit is contained in:
parent
9f13c29cd7
commit
25848ea99e
@ -10,6 +10,7 @@ import FileSaver from 'file-saver';
|
|||||||
import { getLanguage } from '@/lang';
|
import { getLanguage } from '@/lang';
|
||||||
import { encryptBase64, encryptWithAes, generateAesKey, decryptWithAes, decryptBase64 } from '@/utils/crypto';
|
import { encryptBase64, encryptWithAes, generateAesKey, decryptWithAes, decryptBase64 } from '@/utils/crypto';
|
||||||
import { encrypt, decrypt } from '@/utils/jsencrypt';
|
import { encrypt, decrypt } from '@/utils/jsencrypt';
|
||||||
|
import router from "@/router";
|
||||||
|
|
||||||
const encryptHeader = 'encrypt-key';
|
const encryptHeader = 'encrypt-key';
|
||||||
let downloadLoadingInstance: LoadingInstance;
|
let downloadLoadingInstance: LoadingInstance;
|
||||||
@ -134,7 +135,12 @@ service.interceptors.response.use(
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
isRelogin.show = false;
|
isRelogin.show = false;
|
||||||
useUserStore().logout().then(() => {
|
useUserStore().logout().then(() => {
|
||||||
location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
|
router.replace({
|
||||||
|
path: '/login',
|
||||||
|
query: {
|
||||||
|
redirect: encodeURIComponent(router.currentRoute.value.fullPath || '/')
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
isRelogin.show = false;
|
isRelogin.show = false;
|
||||||
|
@ -97,7 +97,7 @@ const tenantEnabled = ref(true);
|
|||||||
|
|
||||||
// 注册开关
|
// 注册开关
|
||||||
const register = ref(false);
|
const register = ref(false);
|
||||||
const redirect = ref(undefined);
|
const redirect = ref('');
|
||||||
const loginRef = ref<ElFormInstance>();
|
const loginRef = ref<ElFormInstance>();
|
||||||
// 租户列表
|
// 租户列表
|
||||||
const tenantList = ref<TenantVO[]>([]);
|
const tenantList = ref<TenantVO[]>([]);
|
||||||
@ -105,7 +105,7 @@ const tenantList = ref<TenantVO[]>([]);
|
|||||||
watch(
|
watch(
|
||||||
() => router.currentRoute.value,
|
() => router.currentRoute.value,
|
||||||
(newRoute: any) => {
|
(newRoute: any) => {
|
||||||
redirect.value = newRoute.query && newRoute.query.redirect;
|
redirect.value = newRoute.query && decodeURIComponent(newRoute.query.redirect);
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user