Pārlūkot izejas kodu

忘记密码,系统内修改密码样式调整

cxmo 1 gadu atpakaļ
vecāks
revīzija
a658a1d412

+ 19 - 17
src/views/Login.vue

@@ -180,21 +180,7 @@ export default {
         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
-                }
-            }
-        }
+        this.getRememberedInfo()
     },
     methods: {
         keyupSubmit() {
@@ -299,9 +285,11 @@ export default {
             })
         },
         handleClick(tab) {
-            console.log('a',tab)
             //调用对应model的init方法
             this.$refs[tab.name]&&this.$refs[tab.name].modelInit()
+            if(tab.name==='ordinaryModel'){
+                this.getRememberedInfo()
+            }
         },
         changeModel(model){
             this.activeModel = model
@@ -454,8 +442,22 @@ export default {
                     path = await this.getOtherRolePath("myCalendar");
             }
             this.$router.push({ path });
+        },
+        //获取用户记住的账号密码 如果有
+        getRememberedInfo(){
+            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.$refs.ordinaryModel.form = {
+                        account:this.b.decode(userAccount),
+                        checkPass:this.b.decode(userCheckPass),
+                        checked:true
+                    }
+                }
+            }
         }
-
     },
     destroyed() {
         document.onkeydown = null;

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

@@ -100,7 +100,7 @@ import ModelSteps from './components/ModelSteps.vue';
 import VerificationBox from './components/VerificationBox.vue';
 import modelMixins from './modelMixins';
 import{patternPassWord} from '@/utils/commonOptions';
-import md5 from "@/utils/md5.js";
+import http from '@/api/http.js';
 import {departInterence } from "@/api/api.js";
 export default {
     mixins:[modelMixins],
@@ -257,18 +257,17 @@ export default {
             
         },
         handleResetPass(){
-            console.log('?')
             if(this.checkPassStr.includes('去登陆')){
                 this.$emit('changeModel')
+                return
             }
             this.$refs.passForm.validate((valid)=>{
                 if(valid){
-                    console.log('到这步了')
                     //重置密码
                     departInterence.resetPass({
                         UserName:this.form.account,
-                        Password:md5.hex_md5(this.passForm.pass1),
-                        RePassword:md5.hex_md5(this.passForm.pass2)
+                        Password:new http.Base64().encode(this.passForm.pass1),
+                        RePassword:new http.Base64().encode(this.passForm.pass2)
                     }).then(res=>{
                         if(res.Ret!==200) return
                         this.$message.success('重置密码成功,请登陆')

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

@@ -20,7 +20,7 @@
             </el-form-item>
             <el-form-item prop="checkPass">
                 <el-input
-                    type="password"
+                    type="password" show-password
                     v-model="form.checkPass"
                     auto-complete="off"
                     placeholder="请输入密码"

+ 18 - 2
src/views/resetpassword.vue

@@ -86,7 +86,7 @@
             ></i>
           </el-input>
         </el-form-item>
-        <el-form-item style="text-align: center; padding-top: 20px">
+        <el-form-item style="text-align: center;">
           <el-button type="primary" size="medium" @click.native="addSubmit"
             >确定</el-button
           >
@@ -107,6 +107,7 @@
 import { modifyPwd } from "@/api/api.js";
 import http from "@/api/http.js";
 import md5 from "@/utils/md5.js";
+import{patternPassWord} from '@/utils/commonOptions';
 export default {
   data() {
     return {
@@ -126,6 +127,15 @@ export default {
           },
         ],
         NewPwd: [
+            {
+                validator:(rule,value,callback)=>{
+                    if(!patternPassWord.test(value)){
+                        callback(new Error('密码要求8位及以上,包含数字、大写字母、小写字母、特殊字符中的三个类型'))
+                    }else{
+                        callback()
+                    }
+                }
+            },
           {
             required: true,
             message: "请输入确认密码",
@@ -188,4 +198,10 @@ export default {
 };
 </script>
 
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.box-card{
+    .el-form-item{
+        margin-bottom: 40px;
+    }
+}
+</style>

+ 2 - 2
src/views/system_manage/departManage.vue

@@ -340,10 +340,10 @@
 		>
 			<div class="dialog-container">
 				<el-form ref="resetForm" :model="resetForm" :rules="resetRules" label-width="100px">
-					<el-form-item label="新密码" prop="password">
+					<el-form-item label="新密码" prop="password" style="margin-bottom: 40px;">
 						<el-input v-model="resetForm.password" style="width:100%" :show-password="true"></el-input>
 					</el-form-item>
-					<el-form-item label="确认新密码" prop="check">
+					<el-form-item label="确认新密码" prop="check" style="margin-bottom: 40px;">
 						<el-input v-model="resetForm.check" style="width:100%" :show-password="true"></el-input>
 					</el-form-item>
 				</el-form>