Browse Source

手机端处理密码暗文显示,处理限制20个字符

Administrator 7 years ago
parent
commit
4358b84579

+ 5 - 10
components/mobile/registerEnterprise/index.vue

@@ -327,17 +327,12 @@
       validatePassword () {
         let reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
         let reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
-        let count = this.step2.password.length
-        if (count >= 20) {
-          this.downToast('密码须为8-20字符的英文、数字混合')
+        if (reg1.test(this.step2.password)) {
+          this.progress = '强'
+        } else if (reg2.test(this.step2.password)) {
+          this.progress = '中'
         } else {
-          if (reg1.test(this.step2.password)) {
-            this.progress = '强'
-          } else if (reg2.test(this.step2.password)) {
-            this.progress = '中'
-          } else {
-            this.progress = '弱'
-          }
+          this.progress = '弱'
         }
       },
       // 验证密码

+ 5 - 10
components/mobile/registerPersonal/index.vue

@@ -106,17 +106,12 @@
       codePwd () {
         let reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
         let reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
-        let count = this.password.length
-        if (count >= 20) {
-          this.downToast('密码须为8-20字符的英文、数字混合')
+        if (reg1.test(this.password)) {
+          this.step = '强'
+        } else if (reg2.test(this.password)) {
+          this.step = '中'
         } else {
-          if (reg1.test(this.password)) {
-            this.step = '强'
-          } else if (reg2.test(this.password)) {
-            this.step = '中'
-          } else {
-            this.step = '弱'
-          }
+          this.step = '弱'
         }
       },
       // 验证密码格式

+ 7 - 10
components/mobile/reset/stepAppeal.vue

@@ -24,6 +24,7 @@
       </div>
       <div class="page-part">
         <mt-field placeholder="新密码"
+                  type="password"
                   v-model="valid.password"
                   :attr="{maxlength: 20}"
                   :state="state.password"
@@ -36,6 +37,7 @@
       </div>
       <div class="page-part">
         <mt-field placeholder="确认密码"
+                  type="password"
                   v-model="valid.confirm"
                   auto-complete="off"
                   :state="state.confirm"
@@ -214,17 +216,12 @@
         validatePassword () {
           let reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
           let reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
-          let count = this.valid.password.length
-          if (count >= 20) {
-            this.downToast('密码须为8-20字符的英文、数字混合')
+          if (reg1.test(this.valid.password)) {
+            this.progress = '强'
+          } else if (reg2.test(this.valid.password)) {
+            this.progress = '中'
           } else {
-            if (reg1.test(this.valid.password)) {
-              this.progress = '强'
-            } else if (reg2.test(this.valid.password)) {
-              this.progress = '中'
-            } else {
-              this.progress = '弱'
-            }
+            this.progress = '弱'
           }
         },
         // 验证密码

+ 1 - 0
components/mobile/reset/stepBefore.vue

@@ -7,6 +7,7 @@
     <div class="f-form">
       <div class="page-part">
         <mt-field placeholder="请输入当前密码"
+                  type="password"
                   auto-complete="off"
                   :state="state.password"
                   @blur.native.capture="hasPassword"

+ 7 - 10
components/mobile/reset/stepNew.vue

@@ -6,6 +6,7 @@
     <div class="f-form">
       <div class="page-part">
         <mt-field placeholder="新密码"
+                  type="password"
                   :attr="{ maxlength: 20 }"
                   :state="state.password"
                   @blur.native.capture="validPasswordTip"
@@ -18,6 +19,7 @@
       </div>
       <div class="page-part">
         <mt-field placeholder="确认密码"
+                  type="password"
                   :state="state.confirm"
                   auto-complet="off"
                   @blur.native.capture="validConfirm"
@@ -59,17 +61,12 @@
       validPassword () {
         let reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
         let reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
-        let count = this.news.password.length
-        if (count >= 20) {
-          this.downToast('密码须为8-20字符的英文、数字混合')
+        if (reg1.test(this.news.password)) {
+          this.progress = '强'
+        } else if (reg2.test(this.news.password)) {
+          this.progress = '中'
         } else {
-          if (reg1.test(this.news.password)) {
-            this.progress = '强'
-          } else if (reg2.test(this.news.password)) {
-            this.progress = '中'
-          } else {
-            this.progress = '弱'
-          }
+          this.progress = '弱'
         }
       },
       // 验证新密码

+ 2 - 2
components/mobile/reset/stepSelect.vue

@@ -5,7 +5,7 @@
     </div>
     <div>
       <ul class="select-item">
-        <li class="item" @click="jump('before')" v-if="$store.state.option.isLogin.data.content.isLogin">
+        <li class="item" @click="jump('before')" v-if="$store.state.option.isLogin.logged">
           <img src="/images/all/icon03.png">
           <span>通过登录密码</span>
           <i class="fa fa-angle-right second"></i>
@@ -56,7 +56,7 @@
       },
       // 获取验证方式
       getVerifyWay () {
-        this.$http.get('/sso/resetPwd/checkType/' + (this.$store.state.option.isLogin.data.content.isLogin ? 'update' : 'reset'))
+        this.$http.get('/sso/resetPwd/checkType/' + (this.$store.state.option.isLogin.logged ? 'update' : 'reset'))
           .then(response => {
             if (response.data.success) {
               this.mobile = response.data.content.mobile

+ 1 - 1
pages/cloudcenter/index.vue

@@ -141,6 +141,7 @@
 <script>
     export default {
       layout: 'cloud',
+      middleware: 'authenticated',
       data () {
         return {
           activeTab: 0,
@@ -150,7 +151,6 @@
           imgUrl: ''
         }
       },
-      middleware: 'authenticated',
       computed: {
         user () {
           let mobile = this.$store.state.option.userInfo.data.content.user.mobile

+ 1 - 1
pages/reset/forgetPasswordValidationAccount.vue

@@ -53,7 +53,7 @@
     mounted () {
       if (this.$route.query.token) {
         this.step = 'security'
-      } else if (this.$store.state.option.isLogin.data.content.isLogin) {
+      } else if (this.$store.state.option.isLogin.logged) {
         this.step = 'select'
       } else {
         this.step = 'first'

+ 5 - 0
pages/reset/passwordResetValidQuestion.vue

@@ -9,6 +9,11 @@
   import PasswordResetValidQuestion from '~components/reset/PasswordResetValidQuestion.vue'
   export default {
     layout: 'default',
+    mounted () {
+      if (this.store.state.option.isMobile) {
+        this.$router.path('/reset/forgetPasswordValidationAccount?token=' + this.$route.query.token)
+      }
+    },
     components: {
       AccountCenterHeader,
       PasswordResetValidQuestion