chore(login): 修改登录页组件,增加租户登录逻辑

This commit is contained in:
MoChou
2025-07-20 12:13:06 +08:00
parent d4397ffd57
commit e63bedc11b
5 changed files with 29 additions and 34 deletions

View File

@@ -8,8 +8,8 @@
size="large"
@submit="handleLogin"
>
<a-form-item v-if="tenantEnabled" field="tenantCode" hide-label>
<a-input v-model="tenantCode" placeholder="请输入租户编码" allow-clear />
<a-form-item v-if="tenantStore.needInputTenantCode" field="tenantCode" hide-label>
<a-input v-model="tenantCode" placeholder="请输入租户编码(不输入时为默认租户)" allow-clear />
</a-form-item>
<a-form-item field="phone" hide-label>
<a-input v-model="form.phone" placeholder="请输入手机号" :max-length="11" allow-clear />
@@ -44,13 +44,12 @@
<script setup lang="ts">
import { type FormInstance, Message } from '@arco-design/web-vue'
// import type { BehaviorCaptchaReq } from '@/apis'
import { computed } from 'vue'
import { type BehaviorCaptchaReq, getSmsCaptcha } from '@/apis'
import { useAppStore, useTabsStore, useUserStore } from '@/stores'
import { useTabsStore, useUserStore } from '@/stores'
import * as Regexp from '@/utils/regexp'
import { useTenantStore } from '@/stores/modules/tenant'
const appStore = useAppStore()
const tenantEnabled = computed(() => appStore.getTenantEnabled())
const tenantStore = useTenantStore()
const formRef = ref<FormInstance>()
const form = reactive({