|
|
@ -18,8 +18,7 @@ import { useDesign } from '@/hooks/web/useDesign' |
|
|
|
import * as authUtil from '@/utils/auth' |
|
|
|
import * as authUtil from '@/utils/auth' |
|
|
|
|
|
|
|
|
|
|
|
import { Verify } from '@/components/Verifition' |
|
|
|
import { Verify } from '@/components/Verifition' |
|
|
|
import { getTenantByWebsite, getTenantIdByName } from '@/api/base/login' |
|
|
|
import { getTenantIdByName } from '@/api/base/login' |
|
|
|
import { noop } from '@/utils' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const FormItem = Form.Item |
|
|
|
const FormItem = Form.Item |
|
|
|
const InputPassword = Input.Password |
|
|
|
const InputPassword = Input.Password |
|
|
@ -71,16 +70,8 @@ async function getCode() { |
|
|
|
// 根据域名,获得租户信息 && 获取租户ID |
|
|
|
// 根据域名,获得租户信息 && 获取租户ID |
|
|
|
async function getTenantId() { |
|
|
|
async function getTenantId() { |
|
|
|
if (tenantEnable === 'true') { |
|
|
|
if (tenantEnable === 'true') { |
|
|
|
const website = location.host |
|
|
|
const res = await getTenantIdByName(formData.tenantName) |
|
|
|
const tenant = await getTenantByWebsite(website).catch(noop) |
|
|
|
authUtil.setTenantId(res) |
|
|
|
if (tenant) { |
|
|
|
|
|
|
|
formData.tenantName = tenant.name |
|
|
|
|
|
|
|
authUtil.setTenantId(tenant.id) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
const res = await getTenantIdByName(formData.tenantName) |
|
|
|
|
|
|
|
authUtil.setTenantId(res) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|