浏览代码

CRM_12.9 bug修复-1

hbchen 1 年之前
父节点
当前提交
5cd911250c

+ 1 - 1
src/views/verification/bindPhoneNo.vue

@@ -102,7 +102,7 @@ import {smsCodeSend,bindMobile,modifyMobile} from '@/api/auth.js'
           // 换绑
           params={
             OldMobile:userInfo.Mobile,
-            Mobile:bindPhone.form.newPhoneNo,
+            NewMobile:bindPhone.form.newPhoneNo,
             SmsCode:bindPhone.form.verificationCode,
             CountryCode:bindPhone.form.newPhoneNoPre || '86'
           }

+ 16 - 7
src/views/verification/login.vue

@@ -4,6 +4,8 @@ import {ElMessageBox,ElMessage} from 'element-plus'
 import { useRouter } from 'vue-router';
 import {CaretBottom} from '@element-plus/icons-vue'
 import {loginApi,registerApi,emailCodeSend} from '@/api/auth.js'
+import { passwordDigitValidator } from './utils/validators';
+// passwordDigitValidator-密码6位
 
 import md5 from 'md5';
 
@@ -45,7 +47,10 @@ import md5 from 'md5';
         callback()
       }
     }, trigger: 'blur'}],
-    password:{required: true, message:'Password cannot be null', trigger: 'blur'}
+    password:[{required: true, message:'Password cannot be null', trigger: 'blur'},
+    {
+      validator:passwordDigitValidator,trigger:'blur'
+    }]
   })
 
   const login=()=>{
@@ -129,7 +134,10 @@ import md5 from 'md5';
     email:[{required: true, message:'Email address cannot be null', trigger: 'blur'},
     {type:'email',message:'Email address format is incorrect', trigger: 'blur'}],
     verificationCode:{required: true, message:'Verification code cannot be null', trigger: 'blur'},
-    password:{required: true, message:'Password cannot be null', trigger: 'blur'},
+    password:[{required: true, message:'Password cannot be null', trigger: 'blur'},
+    {
+      validator:passwordDigitValidator,trigger:'blur'
+    }],
     passwordConfirm:[{required: true, message:'Password cannot be null', trigger: 'blur'},
     {validator:(rule,value,callback)=>{
       if(registerForm.passwordConfirm!==registerForm.password){
@@ -247,7 +255,7 @@ import md5 from 'md5';
                 </div>
               </el-form-item>
               <el-form-item prop="password" style="width: 360px;">
-                <el-input v-model="loginForm.password" size="large" type="password" placeholder="Please enter a password"></el-input>
+                <el-input v-model="loginForm.password" size="large" type="password" placeholder="Please enter at least 6 passwords"></el-input>
               </el-form-item>
             </el-form>
             <div class="register-message-row">
@@ -302,12 +310,12 @@ import md5 from 'md5';
               <el-input v-model.trim="loginForm.phone" style="flex-grow: 1;" placeholder="Please enter your phone number" size="large"></el-input>
             </el-form-item>
             <el-form-item prop="password" label="Password" size="large">
-              <el-input v-model="loginForm.password" size="large"  type="password" placeholder="Please enter a password"></el-input>
+              <el-input v-model="loginForm.password" size="large"  type="password" placeholder="Please enter at least 6 passwords"></el-input>
             </el-form-item>
           </el-form>
           <div class="mobile-login-type-change">
             <span @click="changeLoginType(loginType==1?2:1)">Login with {{ loginType==1?"phone number":"email" }} instead</span>
-            <span @click="psdMissingPageGo">Forgot your password?</span>
+            <span @click="psdMissingPageGo" style="color:#1856A7">Forgot your password?</span>
           </div>
           <el-button type="primary" class="submit-button" @click="login" size="large">Log in now</el-button>
           <div class="privacy-policy">
@@ -339,7 +347,7 @@ import md5 from 'md5';
               <el-input v-model="registerForm.verificationCode" size="large" placeholder="Please enter the verification code"></el-input>
             </el-form-item>
             <el-form-item prop="password" label="Password" size="large" v-if="step==2">
-              <el-input v-model="registerForm.password" size="large" type="password" placeholder="Please enter a password"></el-input>
+              <el-input v-model="registerForm.password" size="large" type="password" placeholder="Please enter at least 6 passwords"></el-input>
             </el-form-item>
             <el-form-item prop="passwordConfirm" style="margin-bottom: 0;" label="Password" size="large" v-if="step==2">
               <el-input v-model="registerForm.passwordConfirm" size="large" type="password" placeholder="Please enter the password again"></el-input>
@@ -470,8 +478,9 @@ import md5 from 'md5';
               }
               .password-miss{
                 font-size: 14px;
-                color: #333333;;
+                // color: #333333;;
                 cursor: pointer;
+                color: #1856A7;
               }
             }      
             .login-hint{

+ 8 - 3
src/views/verification/passwordChange.vue

@@ -4,6 +4,8 @@ import {ElMessage,ElMessageBox} from 'element-plus'
 import { useRouter } from 'vue-router';
 import {psdModify} from '@/api/auth.js'
 import md5 from 'md5';
+import { passwordDigitValidator } from './utils/validators';
+// passwordDigitValidator-密码6位
 
   const router = useRouter()
 
@@ -22,7 +24,10 @@ import md5 from 'md5';
     },
     rules:{
       passwordOrigin:{required: true, message:'Original password cannot be null', trigger: 'blur'},
-      password:{required: true, message:'New password cannot be null', trigger: 'blur'},
+      password:[{required: true, message:'New password cannot be null', trigger: 'blur'},
+      {
+        validator:passwordDigitValidator,trigger:'blur'
+      }],
       passwordConfirm:[{required: true, message:'New Password cannot be null', trigger: 'blur'},
       {validator:(rule,value,callback)=>{
         if(psdChange.form.passwordConfirm!==psdChange.form.password){
@@ -95,7 +100,7 @@ import md5 from 'md5';
             </el-input>
           </el-form-item>
           <el-form-item prop="password">
-            <el-input v-model="psdChange.form.password" size="large" type="password" placeholder="Please enter a new password"></el-input>
+            <el-input v-model="psdChange.form.password" size="large" type="password" placeholder="Please enter at least 6 passwords"></el-input>
           </el-form-item>
           <el-form-item prop="passwordConfirm" style="margin-bottom: 0;">
             <el-input v-model="psdChange.form.passwordConfirm" size="large" type="password" placeholder="Please enter the new password again"></el-input>
@@ -113,7 +118,7 @@ import md5 from 'md5';
             </el-input>
           </el-form-item>
           <el-form-item prop="password" size="large" label="Password">
-            <el-input v-model="psdChange.form.password" size="large" type="password" placeholder="Please enter a new password"></el-input>
+            <el-input v-model="psdChange.form.password" size="large" type="password" placeholder="Please enter at least 6 passwords"></el-input>
           </el-form-item>
           <el-form-item prop="passwordConfirm" style="margin-bottom: 0;" size="large" label="Password">
             <el-input v-model="psdChange.form.passwordConfirm" size="large" type="password" placeholder="Please enter the new password again"></el-input>

+ 29 - 8
src/views/verification/passwordMissing.vue

@@ -5,6 +5,8 @@ import { useRouter } from 'vue-router';
 import {CaretBottom} from '@element-plus/icons-vue'
 import {smsCodeSend,emailCodeSend,psdMissingApi} from '@/api/auth.js'
 import md5 from 'md5';
+import { passwordDigitValidator } from './utils/validators';
+
 
   const router = useRouter()
 
@@ -43,7 +45,10 @@ import md5 from 'md5';
           callback()
         }
       }, trigger: 'blur'}],
-      password:{required: true, message:'Password cannot be null', trigger: 'blur'},
+      password:[{required: true, message:'Password cannot be null', trigger: 'blur'},
+      {
+        validator:passwordDigitValidator,trigger:'blur'
+      }],
       passwordConfirm:[{required: true, message:'Password cannot be null', trigger: 'blur'},
       {validator:(rule,value,callback)=>{
         if(psdMissing.form.passwordConfirm!==psdMissing.form.password){
@@ -69,6 +74,25 @@ const loginType=ref(1)
 const changeLoginType=(type)=>{
   if(type == loginType.value) return 
   loginType.value=type
+  // 重置数据
+  psdMissing.form={
+    email:'',
+    phone:'',
+    phonePre:'86',
+    password:'',
+    passwordConfirm:'',
+    verificationCode:''
+  }
+  codeInfo.timeout=60
+  codeInfo.isRequesting=false
+  codeTimer=null
+  let refTemp;
+  if(isPhone()){
+    refTemp=psdMissingMobileRef.value
+  }else{
+    refTemp=psdMissingRef.value
+  }
+  refTemp.clearValidate()
 }
 
   const sendVerCode=()=>{
@@ -199,7 +223,7 @@ const changeLoginType=(type)=>{
             <el-input v-model="psdMissing.form.verificationCode" size="large" placeholder="Please enter the verification code" class="form-item"></el-input>
           </el-form-item>
           <el-form-item prop="password">
-            <el-input v-model="psdMissing.form.password" size="large" type="password" placeholder="Please enter a password" class="form-item"></el-input>
+            <el-input v-model="psdMissing.form.password" size="large" type="password" placeholder="Please enter at least 6 passwords" class="form-item"></el-input>
           </el-form-item>
           <el-form-item prop="passwordConfirm" style="margin-bottom: 0;">
             <el-input v-model="psdMissing.form.passwordConfirm" size="large" type="password" placeholder="Please enter the password again" class="form-item"></el-input>
@@ -237,7 +261,7 @@ const changeLoginType=(type)=>{
             <el-input v-model="psdMissing.form.verificationCode" size="large" placeholder="Please enter the verification code" class="form-item"></el-input>
           </el-form-item>
           <el-form-item prop="password" size="large" label="Password">
-            <el-input v-model="psdMissing.form.password" size="large" type="password" placeholder="Please enter a password" class="form-item"></el-input>
+            <el-input v-model="psdMissing.form.password" size="large" type="password" placeholder="Please enter at least 6 passwords" class="form-item"></el-input>
           </el-form-item>
           <el-form-item prop="passwordConfirm" style="margin-bottom: 0;" size="large" label="Password">
             <el-input v-model="psdMissing.form.passwordConfirm" size="large" type="password" placeholder="Please enter the password again" class="form-item"></el-input>
@@ -291,12 +315,9 @@ const changeLoginType=(type)=>{
       .mobile-missing-psd-form{
         display: none;
       }
-      // .form-item{
-        // width: 317px;
-      // }
       .psdMissing-button{
         margin-top: 40px;
-        width: 100%;
+        // width: 100%;
         width: 360px;
         background-color: #1856A7;
       }
@@ -355,7 +376,7 @@ const changeLoginType=(type)=>{
         .psdMissing-button{
           margin-top: 40px;
           width: 100%;
-          width: 360px;
+          // width: 360px;
           background-color: #1856A7;
         }
         .login-row{

+ 9 - 3
src/views/verification/register.vue

@@ -4,6 +4,8 @@ import {ElMessage,ElMessageBox} from 'element-plus'
 import { useRouter } from 'vue-router';
 import {registerApi,emailCodeSend} from '@/api/auth.js'
 import md5 from 'md5'
+import { passwordDigitValidator } from './utils/validators';
+// passwordDigitValidator-密码6位
 
   const router = useRouter()
 
@@ -25,7 +27,11 @@ import md5 from 'md5'
       companyName:{required: true, message:'Company name cannot be null', trigger: 'blur'},
       email:[{required: true, message:'Email address cannot be null', trigger: 'blur'},
       {type:'email',message:'Email address format is incorrect', trigger: 'blur'}],
-      password:{required: true, message:'Password cannot be null', trigger: 'blur'},
+      password:[{required: true, message:'Password cannot be null', trigger: 'blur'},
+      {
+        // 密码6位检验
+        validator:passwordDigitValidator,trigger:'blur'
+      }],
       passwordConfirm:[{required: true, message:'Password cannot be null', trigger: 'blur'},
       {validator:(rule,value,callback)=>{
         if(register.form.passwordConfirm!==register.form.password){
@@ -149,10 +155,10 @@ import md5 from 'md5'
             <el-input v-model.trim="register.form.verificationCode" size="large" placeholder="Please enter the email verification code"></el-input>
           </el-form-item>
           <el-form-item prop="password">
-            <el-input v-model="register.form.password" size="large" type="password" placeholder="Please enter a password"></el-input>
+            <el-input v-model.trim="register.form.password" size="large" type="password" placeholder="Please enter at least 6 passwords"></el-input>
           </el-form-item>
           <el-form-item prop="passwordConfirm" style="margin-bottom: 0;">
-            <el-input v-model="register.form.passwordConfirm" size="large" type="password" placeholder="Please enter the password again"></el-input>
+            <el-input v-model.trim="register.form.passwordConfirm" size="large" type="password" placeholder="Please enter the password again"></el-input>
           </el-form-item>
         </el-form>
         <el-button type="primary" @click="registerSubmit" class="register-button" size="large">Submit</el-button>

+ 7 - 0
src/views/verification/utils/validators.js

@@ -0,0 +1,7 @@
+export const passwordDigitValidator=(rule,value,callback)=>{
+  if(value.length<6){
+    callback(new Error('Enter at least 6 digits'))
+  }else{
+    callback()
+  }
+}