Skip to content

Commit 2e495f1

Browse files
committed
fix: 【SYSTEM 系统管理】未开启租户,不使用 url 进行租户识别
1 parent 896e24d commit 2e495f1

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/views/Login/components/LoginForm.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,13 @@ const getLoginFormCache = () => {
239239
}
240240
// 根据域名,获得租户信息
241241
const getTenantByWebsite = async () => {
242-
const website = location.host
243-
const res = await LoginApi.getTenantByWebsite(website)
244-
if (res) {
245-
loginData.loginForm.tenantName = res.name
246-
authUtil.setTenantId(res.id)
242+
if (loginData.tenantEnable === 'true') {
243+
const website = location.host
244+
const res = await LoginApi.getTenantByWebsite(website)
245+
if (res) {
246+
loginData.loginForm.tenantName = res.name
247+
authUtil.setTenantId(res.id)
248+
}
247249
}
248250
}
249251
const loading = ref() // ElLoading.service 返回的实例

src/views/Login/components/RegisterForm.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,13 @@ const getTenantId = async () => {
233233
234234
// 根据域名,获得租户信息
235235
const getTenantByWebsite = async () => {
236-
const website = location.host
237-
const res = await LoginApi.getTenantByWebsite(website)
238-
if (res) {
239-
registerData.registerForm.tenantName = res.name
240-
authUtil.setTenantId(res.id)
236+
if (registerData.tenantEnable === 'true') {
237+
const website = location.host
238+
const res = await LoginApi.getTenantByWebsite(website)
239+
if (res) {
240+
registerData.registerForm.tenantName = res.name
241+
authUtil.setTenantId(res.id)
242+
}
241243
}
242244
}
243245
const loading = ref() // ElLoading.service 返回的实例

0 commit comments

Comments
 (0)