|
|
|
@ -2,7 +2,8 @@
@@ -2,7 +2,8 @@
|
|
|
|
|
<div :class="prefixCls" class="login-background-img"> |
|
|
|
|
<!--多租户选择器--> |
|
|
|
|
<Dropdown |
|
|
|
|
class="absolute top-3 right-40 enter-x" |
|
|
|
|
class="absolute top-3 enter-x" |
|
|
|
|
:class="[getEnabledIdentityProvider ? 'right-40' : 'right-26' ]" |
|
|
|
|
placement="bottom" |
|
|
|
|
:trigger="['hover']" |
|
|
|
|
:dropMenuList="options.tenantIdList" |
|
|
|
@ -18,6 +19,7 @@
@@ -18,6 +19,7 @@
|
|
|
|
|
</Dropdown> |
|
|
|
|
<!--身份提供商多选择器--> |
|
|
|
|
<Dropdown |
|
|
|
|
v-if="getEnabledIdentityProvider" |
|
|
|
|
class="absolute top-3 right-26 enter-x" |
|
|
|
|
placement="bottom" |
|
|
|
|
:trigger="['hover']" |
|
|
|
@ -215,7 +217,7 @@
@@ -215,7 +217,7 @@
|
|
|
|
|
</template> |
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
import { getCaptcha } from '/@/api/platform/core/controller/user'; |
|
|
|
|
import { onMounted, reactive, ref, toRaw, unref } from 'vue'; |
|
|
|
|
import {computed, CSSProperties, onMounted, reactive, ref, toRaw, unref} from 'vue'; |
|
|
|
|
import defaultCaptchaImg from '/@/assets/images/captcha.jpg'; |
|
|
|
|
import { useUserStore } from '/@/store/modules/user'; |
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
@ -265,12 +267,12 @@
@@ -265,12 +267,12 @@
|
|
|
|
|
tenantId: [], |
|
|
|
|
}); |
|
|
|
|
// 手机登录表单字段 |
|
|
|
|
const phoneFormData = reactive<any>({ |
|
|
|
|
const phoneFormData = reactive<Recordable>({ |
|
|
|
|
mobile: '', |
|
|
|
|
smscode: '', |
|
|
|
|
}); |
|
|
|
|
// 下拉数据字段 |
|
|
|
|
const options = reactive<any>({ |
|
|
|
|
const options = reactive<Recordable>({ |
|
|
|
|
identityProviderList: [], |
|
|
|
|
tenantIdList: [] |
|
|
|
|
}); |
|
|
|
@ -475,6 +477,9 @@
@@ -475,6 +477,9 @@
|
|
|
|
|
formData.identityProvider = [menu.event]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const getEnabledIdentityProvider = computed(() => { |
|
|
|
|
return !!~~options.tenantIdList.find(item => item.event === formData.tenantId[0])?.enabledIdentityProvider; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
|
//加载验证码 |
|
|
|
@ -483,14 +488,18 @@
@@ -483,14 +488,18 @@
|
|
|
|
|
options.tenantIdList = tenantIdList.map(item => ({ |
|
|
|
|
text: item.name, |
|
|
|
|
event: item.code, |
|
|
|
|
enabledIdentityProvider: item.enabledIdentityProvider |
|
|
|
|
} as DropMenu)); |
|
|
|
|
options.tenantIdList[0] && (formData.tenantId = [options.tenantIdList[0].event]); |
|
|
|
|
|
|
|
|
|
if (getEnabledIdentityProvider.value) { |
|
|
|
|
const identityProviderList = await getDataByDictType({ type: 'identityProvider', tenantId: formData.tenantId }); |
|
|
|
|
options.identityProviderList = identityProviderList.map(item => ({ |
|
|
|
|
text: item.label, |
|
|
|
|
event: item.value, |
|
|
|
|
} as DropMenu)); |
|
|
|
|
options.identityProviderList[0] && (formData.identityProvider = [options.identityProviderList[0].event]); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|