xieqy 2 년 전
부모
커밋
14ae0207f2
2개의 변경된 파일24개의 추가작업 그리고 24개의 파일을 삭제
  1. 3 3
      src/views/login/modifyPsw.vue
  2. 21 21
      src/views/login/resetPsw.vue

+ 3 - 3
src/views/login/modifyPsw.vue

@@ -57,7 +57,7 @@
 import { Vue, Component, Watch, Prop } from 'vue-property-decorator'
 import { changePassword } from '@/api/base'
 import { verification } from '@/utils/index'
-import { regPassword } from '@/utils/reg'
+import { regNewPassword } from '@/utils/reg'
 import InputItem from '@/components/FormItem/Input/index.vue'
 
 import { encryption } from '@/utils/encryption'
@@ -78,8 +78,8 @@ export default class modifyPsw extends Vue {
       { condition: !this.originalPassword, errmsg: '请输入原密码' },
       { condition: !this.newPassword, errmsg: '请输入新密码' },
       {
-        condition: !regPassword().test(this.newPassword),
-        errmsg: '密码包含大小写字母和数字,不可有非法字符!'
+        condition: !regNewPassword().test(this.newPassword),
+        errmsg: '密码位数至少12位,必须包含大小写字母和数字,不可包含非法字符!'
       },
       {
         condition: this.confirmPassword !== this.newPassword,

+ 21 - 21
src/views/login/resetPsw.vue

@@ -17,7 +17,7 @@
           v-model="userForm.user"
           autocomplete="off"
           type="text"
-          placeholder="请输入用户名或者验证手机号"
+          placeholder="请输入用户名"
           prefix-icon="el-icon-user"
           clearable
         />
@@ -130,27 +130,27 @@ export default class resetPsw extends Vue {
       ;(this.$refs.userForm as ElForm).validate(async (valid) => {
         if (valid) {
           let value = this.userForm.user.trim()
-          if (Number(value)) {
-            if (new RegExp(regPhone()).test(value)) {
-              this.passParam = { phoneNumber: value }
-              const res = await authcodeAdd(this.passParam)
-              if (res.code == 1) {
-                this.$message.success(res.result)
-                this.isPass = true
-                this.modifyParam = { username: value }
-              }
-            } else {
-              this.$message.warning('请输入正确的手机号!')
-            }
-          } else {
-            this.passParam = { username: value }
-            const res = await authcodeAdd(this.passParam)
-            if (res.code == 1) {
-              this.$message.success(res.result)
-              this.isPass = true
-              this.modifyParam = { username: value }
-            }
+          // if (Number(value)) {
+          //   if (new RegExp(regPhone()).test(value)) {
+          //     this.passParam = { phoneNumber: value }
+          //     const res = await authcodeAdd(this.passParam)
+          //     if (res.code == 1) {
+          //       this.$message.success(res.result)
+          //       this.isPass = true
+          //       this.modifyParam = { username: value }
+          //     }
+          //   } else {
+          //     this.$message.warning('请输入正确的手机号!')
+          //   }
+          // } else {
+          this.passParam = { phoneNumber: value }
+          const res = await authcodeAdd(this.passParam)
+          if (res.code == 1) {
+            this.$message.success(res.result)
+            this.isPass = true
+            this.modifyParam = { username: value }
           }
+          // }
         }
       })
     } else {