Просмотр исходного кода

chore: 消除前端登录页爆红

喵你个旺呀 1 год назад
Родитель
Сommit
e8c9e00cc2

+ 5 - 2
Web/src/views/login/component/account.vue

@@ -23,7 +23,7 @@
 					</template>
 				</el-input>
 			</el-form-item>
-			<el-form-item class="login-animation2" prop="tenantId" clearable v-if="!tenantInfo.list.some(e => e.host === tenantInfo.host)">
+			<el-form-item class="login-animation2" prop="tenantId" clearable v-if="!tenantInfo.list.some((e: any) => e.host === tenantInfo.host)">
 				<el-select v-model="state.ruleForm.tenantId" :placeholder="$t('message.account.accountPlaceholder3')" style="width: 100%">
 					<template #prefix>
 						<i class="iconfont icon-shuxingtu el-input__icon"></i>
@@ -99,7 +99,10 @@ import { accessTokenKey, clearTokens, feature, getAPI } from '/@/utils/axios-uti
 import { SysAuthApi } from '/@/api-services/api';
 
 const props = defineProps({
-	tenantInfo: {},
+	tenantInfo: {
+		required: true,
+		type: Object,
+	},
 });
 
 // 旋转图片滑块组件

+ 5 - 2
Web/src/views/login/component/mobile.vue

@@ -1,6 +1,6 @@
 <template>
 	<el-form size="large" class="login-content-form">
-		<el-form-item class="login-animation1" v-if="!tenantInfo.list.some(e => e.host === tenantInfo.host)">
+		<el-form-item class="login-animation1" v-if="!tenantInfo.list.some((e: any) => e.host === tenantInfo.host)">
 			<el-select v-model="state.ruleForm.tenantId" :placeholder="$t('message.mobile.placeholder1')" clearable style="width: 100%">
 				<template #prefix>
 					<i class="iconfont icon-shuxingtu el-input__icon"></i>
@@ -48,7 +48,10 @@ import { getAPI } from '/@/utils/axios-utils';
 import { SysSmsApi, SysAuthApi } from '/@/api-services/api';
 
 const props = defineProps({
-	tenantInfo: {},
+	tenantInfo: {
+		required: true,
+		type: Object,
+	},
 });
 
 const route = useRoute();

+ 5 - 2
Web/src/views/login/component/scan.vue

@@ -1,6 +1,6 @@
 <template>
 	<div class="login-scan-container">
-		<el-select v-model="state.tenantId" v-if="!tenantInfo.list.some(e => e.host === tenantInfo.host)" :placeholder="$t('message.scan.placeholder1')" clearable class="mb30" style="width: 260px; align-self: center;">
+		<el-select v-model="state.tenantId" v-if="!tenantInfo.list.some((e: any) => e.host === tenantInfo.host)" :placeholder="$t('message.scan.placeholder1')" clearable class="mb30" style="width: 260px; align-self: center;">
 			<template #prefix>
 				<i class="iconfont icon-shuxingtu el-input__icon"></i>
 			</template>
@@ -19,7 +19,10 @@ import {ref, onMounted, nextTick, reactive} from 'vue';
 import QRCode from 'qrcodejs2-fixes';
 
 const props = defineProps({
-	tenantInfo: {},
+	tenantInfo: {
+		required: true,
+		type: Object,
+	},
 });
 
 const state = reactive({

+ 3 - 3
Web/src/views/login/index.vue

@@ -87,12 +87,12 @@ const getThemeConfig = computed(() => {
 	return themeConfig.value;
 });
 // 页面加载时
-onMounted(() => {
+onMounted(async () => {
+	await getTenantInfo();
 	NextLoading.done();
-	getTenantInfo();
 });
 
-// 处理租户信息
+// 获取租户信息
 const getTenantInfo = async () => {
 	const list = await getAPI(SysTenantApi).apiSysTenantListGet().then(res => res.data.result ?? []);
 	const tenant = list.find((item: any) => item.host === state.tenantInfo.host);