瀏覽代碼

账号登陆

cxmo 1 年之前
父節點
當前提交
626ac009b8

+ 75 - 0
src/api/modules/setApi.js

@@ -260,7 +260,82 @@ const departInterence = {
 	//获取用户所有的按钮权限
 	getRoleBtnAuth:params=>{
 		return http.get('/system/role/menu/buttons',params)
+	},
+	/**
+	 * 获取图形验证码 返回Base64格式数据
+	 * @returns 
+	 */
+	getCodePic:params=>{
+		return http.get('/user_login/get_captcha',params)
+	},
+	/**
+	 * 获取短信/邮箱验证码
+	 * @param {Number} VerifyType 验证方式: 1-手机号; 2-邮箱
+	 * @param {String} CaptchaId 图形验证码ID
+	 * @param {String} CaptchaCode 图形验证码的值
+	 * @param {String} Mobile 手机号 验证方式为1时必填
+	 * @param {String} Email 邮箱 验证方式为2时必填
+	 * @param {String} TelAreaCode 手机区号
+	 * @param {Number} Source 来源:1-登录;2-异常登录校验;3-忘记密码
+	 * @returns 
+	 */
+	getCodeVerify:params=>{
+		return http.post('/user_login/verify_code',params)
+	},
+	/**
+	 * ETA1.4后,用户登录
+	 * @param {Number} LoginType 登录方式: 1-账号; 2-手机号; 3-邮箱
+	 * @param {Number} AbnormalCheckType 异常登陆校验方式: 1-手机号; 2-邮箱
+	 * @param {String} Username 用户名
+	 * @param {String} Password 密码
+	 * @param {String} Mobile 手机号
+	 * @param {String} Email 邮箱
+	 * @param {String} VerifyCode 手机号/邮箱的验证码
+	 * @returns 
+	 */
+	userLogin:params=>{
+		return http.post('/user_login/login',params)
+	},
+	/**
+	 * 忘记密码账号校验,获取账号信息
+	 * @param {String} CaptchaId 
+	 * @param {String} CaptchaCode 
+	 * @param {String} UserName 
+	 * @returns 
+	 */
+	accountCheck:params=>{
+		return http.post('/user_login/forget/account_get',params)
+	},
+	/**
+	 * 忘记密码-手机/邮箱的验证码校验
+	 * @param {Number} FindType 密码找回方式:1-手机号;2-邮箱
+	 * @param {String} VerifyCode 验证码
+	 * @param {String} UserName 用户名
+	 * @param {String} Mobile 找回方式为手机号时必填
+	 * @param {String} Email 找回方式为邮箱时必填
+	 * @returns 
+	 */
+	checkCodeVerify:params=>{
+		return http.post('/user_login/forget/code_verify',params)
+	},
+	/**
+	 * 忘记密码-重置密码
+	 * @param {String} UserName 
+	 * @param {String} Password 
+	 * @param {String} RePassword 
+	 * @returns 
+	 */
+	resetPass:params=>{
+		return http.post('/user_login/forget/reset_pass',params)
+	},
+	/**
+	 * 获取手机号区号
+	 * @returns 
+	 */
+	getPhoneAreaCode:params=>{
+		return http.get('/user_login/area_code/list',params)
 	}
+
 }
 
 /* 视频管理 */

+ 0 - 6
src/routes/modules/oldRoutes.js

@@ -52,12 +52,6 @@ export default [
   	name:'AI问答',
   	hidden:false
   },
-  {
-    path:'/fogetpassword',
-    component:()=> import('@/views/login_manage/ForgetPassWord.vue'),
-    name:'忘记密码',
-    hidden:false
-  },
 
   // 主页
   {

+ 8 - 1
src/utils/commonOptions.js

@@ -9,4 +9,11 @@ export const areaCode = [
     { value: '62', label: '+62' },
     { value:'081',label: '+081' },
     { value:'44',label: '+44' }
-]
+]
+
+//验证密码的正则 产品定的规则是:8位及以上,包含数字、大写字母、小写字母、特殊字符中的三个类型
+export const patternPassWord = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{8,}$/
+//验证手机号的正则 仅支持国内的
+export const patternPhone = /0?(13|14|15|18|17)[0-9]{9}/
+//验证邮箱的正则
+export const patternEmail = /\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/

+ 157 - 13
src/views/Login.vue

@@ -75,7 +75,9 @@
 						/>
 					</el-tab-pane>
 					<el-tab-pane label="手机号登录" name="mobileModel">
-						<MobileModel ref="mobileModel"/>
+						<MobileModel ref="mobileModel"
+							:areaCode="areaCode"
+						/>
 					</el-tab-pane>
 					<el-tab-pane label="邮箱登录" name="emailModel">
 						<EmailModel ref="emailModel"/>
@@ -94,6 +96,27 @@
 					@changeModel="activeModel = 'ordinaryModel'"/>
 			</div>
 		</div>
+		<!-- 验证弹窗 -->
+		<el-dialog
+			class="check-dialog"
+			:visible.sync="isCheckDialogShow"
+			:close-on-click-modal="false"
+			:modal-append-to-body="false"
+			width="30%"
+			@close="isCheckDialogShow = false"
+			>
+			<el-tabs v-model="checkActiveModel" @tab-click="handleClick">
+				<el-tab-pane label="手机号验证" name="checkMobileModel">
+						<MobileModel ref="checkMobileModel"/>
+					</el-tab-pane>
+					<el-tab-pane label="邮箱验证" name="checkeMailModel">
+						<EmailModel ref="checkEmailModel"/>
+					</el-tab-pane>
+			</el-tabs>
+			<span slot="footer" class="dialog-footer">
+				<el-button type="primary" @click="isCheckDialogShow = false">提 交</el-button>
+			</span>
+		</el-dialog>
 	</div>
 </template>
 
@@ -141,17 +164,32 @@ export default {
             accountForbidden:false,//账号被禁用
             mobileCheck:false,//手机号未绑定
             emailCheck:false,//邮箱未绑定
+            areaCode:[],
+
+            isCheckDialogShow:false,
+            checkActiveModel:'checkMobileModel'
 
         };
     },
     created() {
         this.keyupSubmit(); //回车登录
-        let userAccount = localStorage.getItem("account") || null;
-        let userCheckPass = localStorage.getItem("checkPass") || null;
-        if (userAccount) {
-            this.ruleForm.account = this.b.decode(userAccount);
-            this.ruleForm.checkPass = this.b.decode(userCheckPass);
-            this.checked = true;
+        this.getPhoneCode();//获取手机号区号
+    },
+    mounted(){
+        const timeKey = localStorage.getItem("timeKey")
+        if(timeKey&&this.checkTimeKey(Number(timeKey))){
+            let userAccount = localStorage.getItem("account") || null;
+            let userCheckPass = localStorage.getItem("checkPass") || null;
+            if (userAccount) {
+                /* this.ruleForm.account = this.b.decode(userAccount);
+                this.ruleForm.checkPass = this.b.decode(userCheckPass);
+                this.checked = true; */
+                this.$refs.ordinaryModel.form = {
+                    account:this.b.decode(userAccount),
+                    checkPass:this.b.decode(userCheckPass),
+                    checked:true
+                }
+            }
         }
     },
     methods: {
@@ -160,7 +198,8 @@ export default {
             document.onkeydown = (e) => {
                 let keyval = window.event.keyCode;
                 if (keyval === 13) {
-                    this.handleSubmit2();
+                    //this.handleSubmit2();
+                    this.handleClick()
                 }
             };
         },
@@ -249,24 +288,112 @@ export default {
                 return "/" + pathVal;
             });
         },
+        getPhoneCode(){
+            departInterence.getPhoneAreaCode().then(res=>{
+                if(res.Ret!==200) return 
+                this.areaCode = res.Data||[]
+            })
+        },
         handleClick(tab) {
+            //调用对应model的init方法
+            this.$refs[tab.name]&&this.$refs[tab.name].modelInit()
         },
         handleLogin(){
             //先进行判空的表单验证
             this.$refs[this.activeModel].$refs.modelForm.validate((valid)=>{
                 if(valid){
                     //根据activeName 调用不同的登陆接口
-                    //账号密码错误 将loginCheck置为true
-                    //账号异常 将accountCheck置为true
-                    this.loginCheck = !this.loginCheck
-                    //都Ok就进系统
+                    //账号密码
+                        if(this.activeModel==='ordinaryModel'){
+                            const {account,checkPass,checked} = this.$refs.ordinaryModel.form
+                            departInterence.userLogin({
+                                LoginType:1,
+                                Username:account,
+                                Password:md5.hex_md5(checkPass)
+                            }).then(res=>{
+                                //账号异常 将accountCheck置为true
+                                if(res.Ret===4011){
+                                    this.accountCheck = true
+                                    return 
+                                }
+                                //账号密码错误 将loginCheck置为true
+                                if(res.Ret===402){
+                                    this.loginCheck = true
+                                }
+                                if(res.Ret!==200) return
+                                //登录成功,若设置了保存密码,在localStorage内存储一个时间戳
+                                if(checked){
+                                    this.setLoginDate(1)
+                                    localStorage.setItem("account", this.b.encode(account));
+                                    localStorage.setItem("checkPass", this.b.encode(checkPass));
+                                }else {
+                                    this.setLoginDate(0)
+                                    localStorage.removeItem("account");
+                                    localStorage.removeItem("checkPass");
+                                }
+                                this.setLoginInfo(res)
+                                //this.loginSys(res)
+                            })
+                        }
+                        //this.loginCheck = !this.loginCheck
+                        //都Ok就进系统
+                        //this.isCheckDialogShow = true
+                    //手机号登录
+                    //邮箱登录
                 }
             })
         },
         clearnHint(){
             this.loginCheck = false
             this.accountCheck = false
+        },
+        setLoginDate(type){
+            if(type===0){
+                localStorage.removeItem('timeKey')
+            }else{
+                localStorage.setItem('timeKey',Date.now())
+            }
+
+        },
+        //判断timeKey有没有过期,目前设定的是60天,也就是5184000
+        checkTimeKey(timeKey){
+            const nowKey = Date.now()
+            return Math.floor((nowKey-timeKey)/1000)<5184000
+        },
+        //存储登录的信息
+        setLoginInfo(res){
+            localStorage.setItem("auth", res.Data.Authorization);
+            localStorage.setItem("userName", res.Data.RealName);
+            localStorage.setItem("Role", res.Data.RoleTypeCode);
+            localStorage.setItem("RoleIdentity", res.Data.SysRoleTypeCode);
+            localStorage.setItem("RoleType", res.Data.ProductName);
+            localStorage.setItem("ManageType", res.Data.Authority);
+            localStorage.setItem("AdminId", res.Data.AdminId);
+            localStorage.setItem("AdminName", res.Data.AdminName);
+        },
+        //根据角色判断应该进入系统的哪个页面,进入系统
+        async loginSys(res){
+            switch (res.Data.RoleTypeCode) {
+                case "rai_researcher":
+                case "ficc_researcher":
+                case "researcher":
+                    path = "/reportlist";
+                    break;
+                case "compliance": //合规
+                    path = "/contractapprovallist";
+                    break;
+                case "special_researcher": //特邀研究员
+                    path = "/dataList";
+                    break;
+                case "special_ficc_seller":
+                    path = "/meetingCalendar";
+                    break;
+                default:
+                    path = await this.getOtherRolePath("myCalendar");
+            }
+            this.$router.push({ path });
         }
+
     },
     destroyed() {
         document.onkeydown = null;
@@ -285,6 +412,23 @@ export default {
 		flex: 1;
 		text-align: center;
 	}
+	.check-dialog{
+		.el-dialog{
+			border-radius: 8px;
+			.el-dialog__header{
+				background-color: transparent;
+				.el-dialog__headerbtn>i{
+					color: #C0C4CC;
+				}
+			}
+			.el-input{
+				width:100%;
+			}
+			.el-dialog__footer{
+				text-align: center;
+			}
+		}
+	}
 }
 </style>
 <style lang="scss" scoped>
@@ -338,7 +482,7 @@ export default {
 			}
 			.submit_btn {
 				width: 100%;
-				height: 60px;
+				height: 50px;
 				background: #3654C1;
 				font-size: 20px;
 				border-radius: 5px;

+ 3 - 0
src/views/login_manage/EmailModel.vue

@@ -46,7 +46,9 @@
 </template>
 
 <script>
+import modelMixins from './modelMixins';
 export default {
+    mixins:[modelMixins],
     props:{
         emailCheck:{
             type:Boolean,
@@ -59,6 +61,7 @@ export default {
     },
     data() {
         return {
+            hasPicCode:true,
             picSrc:'',
             canRequest:false,
             codeStr:'获取验证码',

+ 44 - 5
src/views/login_manage/ForgetPassModel.vue

@@ -73,22 +73,22 @@
                     :rules="passRules">
                     <el-form-item prop="pass1">
                         <el-input
-                            type="text"
-                            v-model="passForm.pass1"
+                            type="password" show-password
+                            v-model.trim="passForm.pass1"
                             auto-complete="off"
                             placeholder="请输入新密码">
                         </el-input>
                     </el-form-item>
                     <el-form-item prop="pass2">
                         <el-input
-                            type="text"
-                            v-model="passForm.pass2"
+                            type="password" show-password
+                            v-model.trim="passForm.pass2"
                             auto-complete="off"
                             placeholder="请确认新密码">
                         </el-input>
                     </el-form-item>
                 </el-form>
-                <el-button class="submit_btn">确定</el-button>
+                <el-button class="submit_btn" @click="handleResetPass">确定</el-button>
             </div>
         </div>
     </div>
@@ -98,7 +98,10 @@
 import CaptchaInput from './components/CaptchaInput.vue';
 import ModelSteps from './components/ModelSteps.vue';
 import VerificationBox from './components/VerificationBox.vue';
+import modelMixins from './modelMixins';
+import{patternPassWord} from '@/utils/commonOptions';
 export default {
+    mixins:[modelMixins],
     props:{
         autoAccount:{//自动填写的账号,如果有,作为form.accout的初始值
             type:'String',
@@ -107,8 +110,30 @@ export default {
     },
     components: { VerificationBox, ModelSteps, CaptchaInput },
     data() {
+        const validatePass = (rule,value,callback)=>{
+            console.log('check')
+            if(value===''){
+                callback(new Error('请输入新密码'))
+            }
+            if(this.passForm.pass2!==''){
+                this.$refs.passForm.validateField('pass2')
+            }
+            if(!patternPassWord.test(value)){
+                callback(new Error('密码要求8位及以上,包含数字、大写字母、小写字母、特殊字符中的三个类型'))
+            }else{
+                callback()
+            }
+        }
+        const validateCheck = (rule,value,callback)=>{
+            if(value===''){
+                callback(new Error('请输入确认密码'))
+            }else if(value!==this.passForm.pass1){
+                callback(new Error('两次输入的密码不一致,请检查'))
+            }
+        }
         return {
             currentStep:0,
+            /* form */
             form:{//步骤0的表单
                 account:'123456',
                 picCode:''
@@ -121,6 +146,12 @@ export default {
                 pass1:'',
                 pass2:''
             },
+            /* form rule */
+            rules:{},
+            passRules:{
+                pass1:[{validator: validatePass,trigger: 'blur'}],
+                pass2:[{validator: validateCheck,trigger: 'blur'}]
+            },
             userMobile:'',//用户的手机号
             userEmail:'',//用户的邮箱
             authCode:'',//手机/邮箱验证码,从CaptchaInput组件中取
@@ -150,6 +181,14 @@ export default {
                 this.$emit('changeModel')
             }
             
+        },
+        handleResetPass(){
+            this.$refs.passForm.validate((valid)=>{
+                if(valid){
+                    //重置密码
+                    console.log('不会吧')
+                }
+            })
         }
     },
 };

+ 0 - 135
src/views/login_manage/ForgetPassWord.vue

@@ -1,135 +0,0 @@
-<template>
-    <div class="forget-password-wrap">
-        <img class="login-icon" :src="$setting.login_logo">
-        <div class="account-box" v-if="!hasAccount">
-            请输入账号密码
-
-            <el-button @click="goSteps">下一步</el-button>
-        </div>
-        <div class="main-box" v-else>
-            <div class="step-hint">您正在找回账号 qychen@it 的密码</div>
-            <div class="step">
-                <el-steps :active="active">
-                    <el-step v-for="(step,index) in steps" :key="index"
-                        :title="`0${index+1}${step}`"></el-step>
-                </el-steps>
-            </div>
-            <div class="step-container" v-if="stepNumber===2&&active===0">
-                <VerificationBox v-if="accountHasMobile"
-                    verifies-type="mobile"
-                    info-text="12345678901"
-                    @goNext="chooseVerifiedWay"
-                />
-                <VerificationBox v-if="accountHasEmail"
-                    verifies-type="email"
-                    info-text="1234@qq.com"
-                    @goNext="chooseVerifiedWay"
-                />
-            </div>
-            <div class="step-container" v-if="(stepNumber===2&&active===1)||(stepNumber===1&&active===0)">
-                <VerificationBox 
-                    :verifies-type="verifiedWay"
-                    :info-text="verifiedWay==='mobile'?mobileText:emailText"
-                    btnText="获取验证码"
-                    @goNext="getCode"
-                />
-                <el-input placeholder="请输入验证码"></el-input>
-                <el-button v-if="stepNumber===2" @click="active = 0">上一步</el-button>
-                <el-button @click="goSetPassWord">下一步</el-button>
-            </div>
-            <div class="step-container" v-if="(stepNumber===2&&active===2)||(stepNumber===1&&active===1)">
-                <el-form>
-                    <el-form-item>
-                        <el-input placeholder="请输入新密码"></el-input>
-                    </el-form-item>
-                    <el-form-item>
-                        <el-input placeholder="请确认新密码"></el-input>
-                    </el-form-item>
-                </el-form>
-                <el-button @click="setNewPassWord">下一步</el-button>
-            </div>
-            <div class="finish-step" v-if="active===steps.length">
-                设置成功
-                <el-button>去登录页</el-button>
-            </div>
-        </div>
-    </div>
-</template>
-
-<script>
-import VerificationBox from './components/VerificationBox.vue';
-
-export default {
-    components: { VerificationBox },
-    data() {
-        return {
-            hasAccount:false,
-            active: 0,
-            accountHasMobile: true,//该账号是否绑定了手机号
-            mobileText:'123456',
-            accountHasEmail: true,//该账号是否绑定了邮箱
-            emailText:'123@qq.com',
-            verifiedWay:'',
-            steps:['选择验证方式','进行安全验证','设置密码'],
-        };
-    },
-    computed:{
-        stepNumber(){
-            return this.accountHasMobile+this.accountHasEmail
-        }
-    },
-    watch:{
-        hasAccount(newVal){
-            if(newVal){
-                this.steps = this.stepNumber===2?this.steps:this.steps.slice(1)
-            }
-        }
-    },
-    methods: {
-        goSteps(){
-            //验证账号和图形验证码,通过后拿到用户的验证方式,手机或邮箱,或者两个都有
-            this.accountHasMobile = true
-            this.accountHasEmail = true
-            this.hasAccount = true
-        },
-        chooseVerifiedWay(way){
-            this.verifiedWay = way
-            if(way==='mobile'){
-                this.accountHasMobile = true
-                this.mobileText = '用户的手机号'
-            }else{
-                this.accountHasEmail = true
-                this.emailText = '用户的邮箱'
-            }
-            this.active = 1
-        },
-        //获取验证码
-        getCode(){
-            //发送成功后60秒倒计时
-        },
-        goSetPassWord(){
-            //接口验证 验证码是否正确
-            this.active++
-        },
-        setNewPassWord(){
-
-        }
-    },
-};
-</script>
-
-<style scoped lang="scss">
-.forget-password-wrap{
-    .login-icon {
-        position: absolute;
-        top: 40px;
-        left: 40px;
-    }
-    .main-box,.account-box{
-        margin-top:120px;
-        width:1200px;
-        margin-left: auto;
-        margin-right: auto;
-    }
-}
-</style>

+ 17 - 6
src/views/login_manage/MobileModel.vue

@@ -15,8 +15,8 @@
                     placeholder="请输入手机号"
                 >
                     <el-select v-model="areaCodeSelect" slot="prepend" placeholder="请选择">
-                        <el-option v-for="item in areaCode" :key="item.value"
-                            :label="item.label" :value="item.value" />
+                        <el-option v-for="item in areaCode" :key="item.Value"
+                            :label="item.Name" :value="item.Value" />
                     </el-select>
                 </el-input>
                 <span class="inline-message el-form-item__error" 
@@ -32,7 +32,7 @@
                     auto-complete="off"
                     placeholder="请输入图形验证码"
                 >
-                    <div class="pic-box" slot="append">
+                    <div class="pic-box" slot="append" @click="getCodePic">
                         <img :src="picSrc" alt="图形验证码"/>
                     </div>
                 </el-input>
@@ -44,15 +44,17 @@
                     auto-complete="off"
                     placeholder="请输入验证码">
                 </el-input>
-                <el-button type="text" class="code-btn">获取验证码</el-button>
+                <el-button type="text" class="code-btn" @click="checkForm">获取验证码</el-button>
             </el-form-item>
         </el-form>
     </div>
 </template>
 
 <script>
-import {areaCode} from '@/utils/commonOptions';
+import modelMixins from './modelMixins';
+import {departInterence } from "@/api/api.js";
 export default {
+    mixins:[modelMixins],
     props:{
         mobileCheck:{
             type:Boolean,
@@ -61,11 +63,15 @@ export default {
         accountForbidden:{
             type:Boolean,
             default:false
+        },
+        areaCode:{
+            type:Array,
+            default:()=>{return []}
         }
     },
     data() {
         return {
-            areaCode:areaCode,
+            hasPicCode:true,//是否需要图形验证码
             areaCodeSelect:'86',
             picSrc:'',
             canRequest:false,
@@ -75,7 +81,12 @@ export default {
         };
     },
     methods: {
+        checkForm(){
+            //检查手机号和图形验证码是否正确
+            //不通过就return 
+            //通过请求发送验证码
 
+        }
     },
 };
 </script>

+ 3 - 1
src/views/login_manage/OrdinaryModel.vue

@@ -30,7 +30,7 @@
                     {{hintMessage}}</span>
             </el-form-item>
             <el-form-item class="remember-cont" prop="checked">
-                <el-checkbox v-model="checked" class="remember">
+                <el-checkbox v-model="form.checked" class="remember">
                     记住账号密码
                     <el-tooltip effect="dark" content="有效期60天" placement="top">
                         <span class="hint-text">
@@ -45,7 +45,9 @@
 </template>
 
 <script>
+import modelMixins from './modelMixins';
 export default {
+    mixins:[modelMixins],
     props:{
         loginCheck:{
             type:Boolean,

+ 6 - 6
src/views/login_manage/css/formStyle.scss

@@ -23,9 +23,9 @@
     .el-form-item{
         margin-bottom: 40px;
         .el-input__inner{
-            height: 60px;
+            height: 50px;
             border-radius: 8px;
-            font-size: 18px;
+            font-size: 16px;
         }
     }
     .el-form-item.is-error{
@@ -49,13 +49,13 @@
         }
         .el-input__inner{
             flex: 1;
-            height: 60px !important;
+            height: 50px !important;
         }
         .el-input-group__prepend,.el-input-group__append{
             padding:0 !important;
             background-color: #fff;
             width:110px;
-            height: 60px;
+            height: 50px;
             box-sizing: border-box;
             .el-input__inner{
                 padding:0;
@@ -88,7 +88,7 @@
     }
     .submit_btn {
         width: 100%;
-        height: 60px;
+        height: 50px;
         background: #3654C1;
         font-size: 20px;
         border-radius: 5px;
@@ -98,7 +98,7 @@
         position:relative;
         .code-btn{
             position:absolute;
-            top:10px;
+            top:5px;
             right: 20px;
             font-size: 16px;
         }

+ 14 - 0
src/views/login_manage/modelMixins.js

@@ -0,0 +1,14 @@
+export default {
+    methods:{
+        modelInit(){
+            //重置表单
+            this.form = this.$options.data().form
+            //如果有图形验证码,重新请求
+            this.hasPicCode && this.getCodePic()
+        },
+        //获取图片验证码
+        getCodePic(){
+            //存base64和id
+        }
+    }
+}

+ 8 - 5
src/views/system_manage/mixin/departManageMixin.js

@@ -5,7 +5,8 @@
  */
 import { departInterence } from '@/api/api.js';
 import http from '@/api/http.js';
-import AddUserDialog from '../components/addUserDialog.vue'
+import AddUserDialog from '../components/addUserDialog.vue';
+import{patternPassWord} from '@/utils/commonOptions';
 
 export default {
     components:{AddUserDialog},
@@ -13,10 +14,13 @@ export default {
         const validatePass = (rule,value,callback)=>{
             if(value===''){
                 callback(new Error('请输入新密码'))
+            }
+            if(this.resetForm.check!==''){
+                this.$refs.resetForm.validateField('check')
+            }
+            if(!patternPassWord.test(value)){
+                callback(new Error('密码要求8位及以上,包含数字、大写字母、小写字母、特殊字符中的三个类型'))
             }else{
-                if(this.resetForm.check!==''){
-                    this.$refs.resetForm.validateField('check')
-                }
                 callback()
             }
         }
@@ -26,7 +30,6 @@ export default {
             }else if(value!==this.resetForm.password){
                 callback(new Error('两次输入的密码不一致'))
             }
-            callback()
         }
         return {
             isExtraUserFormItemShow: false, //是否显示额外的用户表单项