update 优化 三方登录不同域名获取不到租户id问题

This commit is contained in:
疯狂的狮子Li
2024-06-18 18:44:17 +08:00
parent 3c713c9258
commit 72610ab194
2 changed files with 8 additions and 12 deletions

View File

@ -17,18 +17,22 @@ const loading = ref(true);
const code = route.query.code as string;
const state = route.query.state as string;
const source = route.query.source as string;
const tenantId = localStorage.getItem('tenantId') ? (localStorage.getItem('tenantId') as string) : '000000';
const tenantId = route.query.tenantId as string ? route.query.tenantId as string : '000000';
const processResponse = async (res: any) => {
if (res.code !== 200) {
throw new Error(res.msg);
}
if (res.data !== null) {
if (res.data !== null && res.data.access_token !== null) {
setToken(res.data.access_token);
}
ElMessage.success(res.msg);
setTimeout(() => {
location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
if (res.data !== null && res.data.domain !== null) {
location.href = res.data.domain + import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
} else {
location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
}
}, 2000);
};