😎恢复登录时获取租户ID参数处理
This commit is contained in:
parent
285c285fa5
commit
43bbb1ff72
@ -229,8 +229,7 @@ const onSignIn = async () => {
|
|||||||
const publicKey = window.__env__.VITE_SM_PUBLIC_KEY;
|
const publicKey = window.__env__.VITE_SM_PUBLIC_KEY;
|
||||||
const password = sm2.doEncrypt(state.ruleForm.password, publicKey, 1);
|
const password = sm2.doEncrypt(state.ruleForm.password, publicKey, 1);
|
||||||
|
|
||||||
//const tenantid = route.query.tid ?? 0;
|
const tenantid = route.query.tid ?? 0;
|
||||||
const tenantid = Local.get('tid') ?? 0;
|
|
||||||
const [err, res] = await feature(getAPI(SysAuthApi).apiSysAuthLoginPost({ ...state.ruleForm, password: password, tenantId: Number(tenantid) }));
|
const [err, res] = await feature(getAPI(SysAuthApi).apiSysAuthLoginPost({ ...state.ruleForm, password: password, tenantId: Number(tenantid) }));
|
||||||
if (err) {
|
if (err) {
|
||||||
getCaptcha(); // 重新获取验证码
|
getCaptcha(); // 重新获取验证码
|
||||||
|
|||||||
@ -102,7 +102,7 @@ import { Local } from '/@/utils/storage';
|
|||||||
// 引入多语言
|
// 引入多语言
|
||||||
import { languageList, getCountryCode } from '/@/i18n';
|
import { languageList, getCountryCode } from '/@/i18n';
|
||||||
import '/node_modules/flag-icons/css/flag-icons.min.css';
|
import '/node_modules/flag-icons/css/flag-icons.min.css';
|
||||||
import { getTenantIdByHostname } from '/@/api/login/index';
|
|
||||||
// 引入组件
|
// 引入组件
|
||||||
const Account = defineAsyncComponent(() => import('/@/views/login/component/account.vue'));
|
const Account = defineAsyncComponent(() => import('/@/views/login/component/account.vue'));
|
||||||
const Mobile = defineAsyncComponent(() => import('/@/views/login/component/mobile.vue'));
|
const Mobile = defineAsyncComponent(() => import('/@/views/login/component/mobile.vue'));
|
||||||
@ -129,13 +129,7 @@ onMounted(async () => {
|
|||||||
if (!route.query.tid) Local.remove('tid');
|
if (!route.query.tid) Local.remove('tid');
|
||||||
var tenantid = Number(route.query.tid);
|
var tenantid = Number(route.query.tid);
|
||||||
if (isNaN(tenantid)) {
|
if (isNaN(tenantid)) {
|
||||||
// 确保hostname不包含端口号
|
tenantid = 0;
|
||||||
const hostnameWithoutPort = window.location.hostname;
|
|
||||||
const data = await getTenantIdByHostname(hostnameWithoutPort);
|
|
||||||
console.log('tenantid', data.data.result);
|
|
||||||
tenantid = data.data.result;
|
|
||||||
if (tenantid > 99999)
|
|
||||||
Local.set('tid', tenantid);
|
|
||||||
} else if (tenantid > 99999) {
|
} else if (tenantid > 99999) {
|
||||||
Local.set('tid', tenantid);
|
Local.set('tid', tenantid);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user