Revert "feat: 本地开发默认 website"

This reverts commit 198cd6912c.
This commit is contained in:
puhui999
2025-04-03 21:03:54 +08:00
parent ba82401cd4
commit 6ecfcb07bd
5 changed files with 22 additions and 51 deletions

View File

@@ -1,31 +1,21 @@
<script lang="ts" setup>
import type { VbenFormSchema } from '@vben/common-ui';
import {type AuthApi, checkCaptcha, getCaptcha } from '#/api/core/auth';
import type { AuthApi } from '#/api/core/auth';
import { computed, onMounted, ref } from 'vue';
import { computed, markRaw, onMounted, ref } from 'vue';
import { AuthenticationLogin, Verification, z } from '@vben/common-ui';
import { useAppConfig } from '@vben/hooks';
import { $t } from '@vben/locales';
import { useAppConfig } from '@vben/hooks';
import { useAuthStore } from '#/store';
import { useAccessStore } from '@vben/stores';
import {
checkCaptcha,
getCaptcha,
getTenantByWebsite,
getTenantSimpleList,
} from '#/api/core/auth';
import { useAuthStore } from '#/store';
import { getTenantSimpleList, getTenantByWebsite } from '#/api/core/auth';
const { tenantEnable, captchaEnable } = useAppConfig(import.meta.env, import.meta.env.PROD);
defineOptions({ name: 'Login' });
const isProduction = import.meta.env.PROD;
const { tenantEnable, captchaEnable, website } = useAppConfig(
import.meta.env,
isProduction,
);
const authStore = useAuthStore();
const accessStore = useAccessStore();
@@ -42,13 +32,11 @@ const fetchTenantList = async () => {
}
try {
// 获取租户列表、域名对应租户
const websiteTenantPromise = getTenantByWebsite(
isProduction ? window.location.hostname : website, // 生成环境使用真实域名开发环境固定
);
const websiteTenantPromise = getTenantByWebsite(window.location.hostname);
tenantList.value = await getTenantSimpleList();
// 选中租户:域名 > store 中的租户 > 首个租户
let tenantId: null | number = null;
let tenantId: number | null = null;
const websiteTenant = await websiteTenantPromise;
if (websiteTenant?.id) {
tenantId = websiteTenant.id;
@@ -80,7 +68,7 @@ const handleLogin = async (values: any) => {
// 无验证码,直接登录
await authStore.authLogin(values);
};
}
/** 验证码通过,执行登录 */
const handleVerifySuccess = async ({ captchaVerification }: any) => {