408249787@qq.com пре 1 недеља
родитељ
комит
8411cf244a
2 измењених фајлова са 11 додато и 7 уклоњено
  1. 5 5
      pages/user/components/password.uvue
  2. 6 2
      pages/user/login.uvue

+ 5 - 5
pages/user/components/password.uvue

@@ -9,8 +9,8 @@
 			}
 		] as ClFormRule[]
 			">
-			<cl-input clearable class="" :pt="{ className: '!h-[40px] !rounded-xxl !px-4 !w-[80vw]' }" v-model="form.username"
-				placeholder="请输入用户名"></cl-input>
+			<cl-input clearable class="" :pt="{ className: '!h-[40px] !rounded-xxl !px-4 !w-[80vw]' }"
+				v-model="form.username" placeholder="请输入用户名"></cl-input>
 		</cl-form-item>
 		<cl-form-item prop="password" required :pt="{
 			className: '!mb-4'
@@ -20,13 +20,13 @@
 				message: '密码不能为空'
 			}, {
 				min: 6,
-				max: 12,
+				max: 16,
 				message: '密码长度必须在6到16位之间'
 			}
 		] as ClFormRule[]
 			">
-			<cl-input :pt="{ className: '!h-[40px] !rounded-xxl !px-4 !w-[80vw]' }" clearable v-model="form.password" password
-				placeholder="请输入密码">
+			<cl-input :pt="{ className: '!h-[40px] !rounded-xxl !px-4 !w-[80vw]' }" clearable v-model="form.password"
+				password placeholder="请输入密码">
 			</cl-input>
 		</cl-form-item>
 

+ 6 - 2
pages/user/login.uvue

@@ -44,7 +44,8 @@
 								@tap="toRegister">
 								注册并登录
 							</cl-button>
-							<cl-button v-else :disabled="!agree || !agree2"
+							<cl-button v-else
+								:disabled="!agree || !agree2 || (formData.grant_type == 'quickly_login' && formData.code == '')"
 								:pt="{ className: '!h-[45px] !rounded-full w-[200px] mx-auto' }" :loading="loading"
 								@tap="toLogin">
 								登录
@@ -213,7 +214,10 @@ async function toRegister() {
 		if (valid) {
 			loading.value = true
 			try {
-				await selfRegister(formData.value)
+				await selfRegister({
+					...formData.value,
+					password: formData.value.password && encryptPassword(formData.value.password),
+				})
 				uni.showToast({
 					title: '注册成功',
 					icon: 'success'