Selaa lähdekoodia

优化登陆页样式,将登录注册切换移到下方

夜鹰 4 kuukautta sitten
vanhempi
commit
ec941d537f

+ 4 - 4
Web/src/i18n/pages/login/en.ts

@@ -4,10 +4,10 @@ export default {
 		label1: 'Account login',
 		label2: 'Phone number login',
 		label3: 'User Registration',
-		label4: 'No account? Go',
-		label5: 'Register Account',
-		label6: 'Do you already have an account? Go',
-		label7: 'Login Account',
+		label4: 'No account? ',
+		label5: 'Go Register Account',
+		label6: 'Do you already have an account? ',
+		label7: 'Go Login Account',
 	},
 	link: {
 		one3: 'Third party login',

+ 4 - 4
Web/src/i18n/pages/login/zh-cn.ts

@@ -4,10 +4,10 @@ export default {
 		label1: '账号登录',
 		label2: '手机号登录',
 		label3: '用户注册',
-		label4: '没有账号? ',
-		label5: '注册账号',
-		label6: '已有账户? 去',
-		label7: '登录账号',
+		label4: '没有账号? ',
+		label5: '注册',
+		label6: '已有账号? ',
+		label7: '登录',
 	},
 	link: {
 		one3: '第三方登录',

+ 4 - 4
Web/src/i18n/pages/login/zh-tw.ts

@@ -4,10 +4,10 @@ export default {
 		label1: '帳號登入',
 		label2: '手機號登入',
 		label3: '用戶註冊',
-		label4: '沒有帳號? ',
-		label5: '註冊帳號',
-		label6: '已有帳戶? 去',
-		label7: '登入帳號',
+		label4: '沒有帳號? ',
+		label5: '註冊',
+		label6: '已有帳號? ',
+		label7: '登入',
 	},
 	link: {
 		one3: '協力廠商登入',

+ 9 - 5
Web/src/views/login/component/register.vue

@@ -116,7 +116,7 @@ const ruleFormRef = ref();
 const accountRef = ref<InputInstance>();
 const codeRef = ref<InputInstance>();
 
-const emits = defineEmits(['reload']);
+const emits = defineEmits(['reload', 'goLogin']);
 const dragRef: any = ref(null);
 const state = reactive({
 	ruleForm: {
@@ -214,7 +214,7 @@ const onRegister = async () => {
 			state.ruleForm.tenantId ??= props.tenantInfo.id ?? props.tenantInfo.list[0]?.value ?? undefined;
 			const [err, res] = await feature(getAPI(SysAuthApi).apiSysAuthUserRegistrationPost({...state.ruleForm, password: password } as any));
 
-			if (res?.data?.code === 200) {
+			if (res?.code === 200) {
 				const registerText = t('message.registerText');
 				ElMessage.success(registerText);
 				emits('goLogin');
@@ -223,7 +223,7 @@ const onRegister = async () => {
 
 			if (err) {
 				getCaptcha(); // 重新获取验证码
-			} else if (res.data.type != 'success') {
+			} else if (res.type != 'success') {
 				getCaptcha(); // 重新获取验证码
 				ElMessage.error(t('message.register.placeholder6'));
 			}
@@ -244,7 +244,7 @@ const openRotateVerify = () => {
 const passRotateVerify = () => {
 	state.rotateVerifyVisible = false;
 	state.isPassRotate = true;
-	onSignIn();
+	//onSignIn();
 };
 
 // 注册处理
@@ -276,7 +276,11 @@ const handleRegister = () => {
 }
 
 .login-content-form {
-	margin-top: 20px;
+	margin-top: 5px;
+
+    .el-form-item--large {
+        margin-bottom: 15px;
+    }
 
 	@for $i from 0 through 4 {
 		.login-animation#{$i} {

+ 12 - 11
Web/src/views/login/index.vue

@@ -45,12 +45,12 @@
 							<i class="iconfont" :class="state.isScan ? 'icon-diannao1' : 'icon-barcode-qr'"></i>
 							<div class="login-content-main-scan-delta"></div>
 						</div>
-						<div class="login-content-main-left" v-if="getThemeConfig.registration">
+						<div class="login-content-main-bottom" v-if="getThemeConfig.registration">
 							<template v-if="state.tabsActiveName != 'register'">
-								{{$t('message.label.label4')}}<el-link class="login-content-main-left-register" @click="() => state.tabsActiveName = 'register'">{{$t('message.label.label5')}}</el-link>
+								{{$t('message.label.label4')}}<el-link class="login-content-main-bottom-register" @click="() => state.tabsActiveName = 'register'">{{$t('message.label.label5')}}</el-link>
 							</template>
 							<template v-else>
-								{{$t('message.label.label6')}}<el-link class="login-content-main-left-register" @click="() => state.tabsActiveName = 'account'">{{$t('message.label.label7')}}</el-link>
+								{{$t('message.label.label6')}}<el-link class="login-content-main-bottom-register" @click="() => state.tabsActiveName = 'account'">{{$t('message.label.label7')}}</el-link>
 							</template>
 						</div>
 					</div>
@@ -120,6 +120,9 @@ const getTenantInfo = async () => {
 	if (tenant?.value) tenantInfo.value.id = parseInt(tenant?.value);
 	return tenantInfo.value;
 }
+
+// 计算登录右侧容器高度(根据是否启用租户选择来决定高度)
+const loginRightWarpHeight = !tenantInfo.value?.id && themeConfig.value.hideTenantForLogin ? '600px' : '660px';
 </script>
 
 <style scoped lang="scss">
@@ -185,7 +188,7 @@ const getTenantInfo = async () => {
 		.login-right-warp {
 			border: 1px solid var(--el-color-primary-light-3);
 			border-radius: 6px;
-			height: 600px;
+			height: v-bind(loginRightWarpHeight); // 600px;
 			position: relative;
 			overflow: hidden;
 			background-color: var(--el-color-white);
@@ -300,17 +303,15 @@ const getTenantInfo = async () => {
 							top: 0px;
 						}
 					}
-					.login-content-main-left {
+					.login-content-main-bottom {
 						position: absolute;
-						top: 10px;
-						left: 10px;
-						width: 150px;
-						height: 50px;
+                        bottom: 30px;
+						left: 50%;
+                        transform: translate(-50%);
 						overflow: hidden;
-						cursor: pointer;
 						transition: all ease 0.3s;
 						user-select: none;
-						.login-content-main-left-register {
+						.login-content-main-bottom-register {
 							top: -1.5px;
 							color: var(--el-color-primary);
 						}