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