parent
019029f3ce
commit
df397ba648
|
@ -16,7 +16,6 @@ import { useAccessStore, useUserStore } from '@vben/stores';
|
|||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { TenantToggle } from '#/components/tenant-toggle';
|
||||
import { $t } from '#/locales';
|
||||
import { resetRoutes } from '#/router';
|
||||
import { useAuthStore, useNotifyStore } from '#/store';
|
||||
|
@ -127,9 +126,9 @@ watch(
|
|||
|
||||
<template>
|
||||
<BasicLayout @clear-preferences-and-logout="handleLogout">
|
||||
<template #header-right-1>
|
||||
<!-- <template #header-right-1>
|
||||
<TenantToggle />
|
||||
</template>
|
||||
</template> -->
|
||||
<template #user-dropdown>
|
||||
<UserDropdown
|
||||
:avatar
|
||||
|
|
|
@ -7,7 +7,6 @@ import type { CaptchaResponse } from '#/api/core/captcha';
|
|||
import { computed, onMounted, ref, useTemplateRef } from 'vue';
|
||||
|
||||
import { AuthenticationLogin, z } from '@vben/common-ui';
|
||||
import { DEFAULT_TENANT_ID } from '@vben/constants';
|
||||
import { $t } from '@vben/locales';
|
||||
|
||||
import { omit } from 'lodash-es';
|
||||
|
@ -16,7 +15,7 @@ import { tenantList } from '#/api';
|
|||
import { captchaImage } from '#/api/core/captcha';
|
||||
import { useAuthStore } from '#/store';
|
||||
|
||||
import { useLoginTenantId } from '../oauth-common';
|
||||
// import { useLoginTenantId } from '../oauth-common';
|
||||
import OAuthLogin from './oauth-login.vue';
|
||||
|
||||
defineOptions({ name: 'Login' });
|
||||
|
@ -68,35 +67,35 @@ onMounted(async () => {
|
|||
await Promise.all([loadCaptcha(), loadTenant()]);
|
||||
});
|
||||
|
||||
const { loginTenantId } = useLoginTenantId();
|
||||
// const { loginTenantId } = useLoginTenantId();
|
||||
|
||||
const formSchema = computed((): VbenFormSchema[] => {
|
||||
return [
|
||||
{
|
||||
component: 'VbenSelect',
|
||||
componentProps: {
|
||||
class: 'bg-background h-[40px] focus:border-primary',
|
||||
contentClass: 'max-h-[256px] overflow-y-auto',
|
||||
options: tenantInfo.value.voList?.map((item) => ({
|
||||
label: item.companyName,
|
||||
value: item.tenantId,
|
||||
})),
|
||||
placeholder: $t('authentication.selectAccount'),
|
||||
},
|
||||
defaultValue: DEFAULT_TENANT_ID,
|
||||
dependencies: {
|
||||
if: () => tenantInfo.value.tenantEnabled,
|
||||
// 可以把这里当做watch
|
||||
trigger: (model) => {
|
||||
// 给oauth登录使用
|
||||
loginTenantId.value = model?.tenantId ?? DEFAULT_TENANT_ID;
|
||||
},
|
||||
triggerFields: ['', 'tenantId'],
|
||||
},
|
||||
fieldName: 'tenantId',
|
||||
label: $t('authentication.selectAccount'),
|
||||
rules: z.string().min(1, { message: $t('authentication.selectAccount') }),
|
||||
},
|
||||
// {
|
||||
// component: 'VbenSelect',
|
||||
// componentProps: {
|
||||
// class: 'bg-background h-[40px] focus:border-primary',
|
||||
// contentClass: 'max-h-[256px] overflow-y-auto',
|
||||
// options: tenantInfo.value.voList?.map((item) => ({
|
||||
// label: item.companyName,
|
||||
// value: item.tenantId,
|
||||
// })),
|
||||
// placeholder: $t('authentication.selectAccount'),
|
||||
// },
|
||||
// defaultValue: DEFAULT_TENANT_ID,
|
||||
// dependencies: {
|
||||
// if: () => tenantInfo.value.tenantEnabled,
|
||||
// // 可以把这里当做watch
|
||||
// trigger: (model) => {
|
||||
// // 给oauth登录使用
|
||||
// loginTenantId.value = model?.tenantId ?? DEFAULT_TENANT_ID;
|
||||
// },
|
||||
// triggerFields: ['', 'tenantId'],
|
||||
// },
|
||||
// fieldName: 'tenantId',
|
||||
// label: $t('authentication.selectAccount'),
|
||||
// rules: z.string().min(1, { message: $t('authentication.selectAccount') }),
|
||||
// },
|
||||
{
|
||||
component: 'VbenInput',
|
||||
componentProps: {
|
||||
|
|
Loading…
Reference in New Issue