Эх сурвалжийг харах

获取验证码和获取验证方式增加返回值的错误判断

hangb 7 жил өмнө
parent
commit
2c1a483205

+ 20 - 16
components/appeal/AccountAppeal.vue

@@ -299,21 +299,25 @@
         this.$http.get(`/appeal/check/mobile`, {params: {mobile: this.account.mobile}})
           .then(response => {
             this.isShowLoading = false
-            this.token = response.data.content.token
-            if (this.token !== '') {
-              this.$message({
-                message: '验证码已经发送到您的手机,请注意查收',
-                type: 'success'
-              })
-              this.sendAccountCode = false
-              this.account_time = 60
-              var accountTime = setInterval(() => {
-                this.account_time--
-                if (this.account_time <= 0) {
-                  this.sendAccountCode = true
-                  clearInterval(accountTime)
-                }
-              }, 1000)
+            if (response.data.success) {
+              this.token = response.data.content.token
+              if (this.token !== '') {
+                this.$message({
+                  message: '验证码已经发送到您的手机,请注意查收',
+                  type: 'success'
+                })
+                this.sendAccountCode = false
+                this.account_time = 60
+                var accountTime = setInterval(() => {
+                  this.account_time--
+                  if (this.account_time <= 0) {
+                    this.sendAccountCode = true
+                    clearInterval(accountTime)
+                  }
+                }, 1000)
+              }
+            } else {
+              return Promise.reject(response.data)
             }
           }).catch(err => {
             this.isShowLoading = false
@@ -338,8 +342,8 @@
           }
           this.$http.post('/appeal/account', param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.goNextStep = false
               } else {
                 this.goNextStep = true

+ 21 - 18
components/appeal/ChangeManagerAppeal.vue

@@ -233,8 +233,8 @@
                     return Promise.reject(response.data)
                   }
                 }).catch(err => {
-                  console.log(err)
-//                  this.$message.error(err.errMsg)
+                  // console.log(err)
+                  this.$message.error(err.errMsg)
                 })
             }
           }
@@ -452,21 +452,25 @@
         this.$http.get(`/appeal/check/mobile`, {params: {mobile: this.changeManager.mobile}})
           .then(response => {
             this.isShowLoading = false
-            this.token = response.data.content.token
-            if (this.token !== '') {
-              this.$message({
-                message: '验证码已经发送到您的手机,请注意查收',
-                type: 'success'
-              })
-              this.sendManagerCode = false
-              this.account_time = 60
-              var accountTime = setInterval(() => {
-                this.account_time--
-                if (this.account_time <= 0) {
-                  this.sendManagerCode = true
-                  clearInterval(accountTime)
-                }
-              }, 1000)
+            if (response.data.success) {
+              this.token = response.data.content.token
+              if (this.token !== '') {
+                this.$message({
+                  message: '验证码已经发送到您的手机,请注意查收',
+                  type: 'success'
+                })
+                this.sendManagerCode = false
+                this.account_time = 60
+                var accountTime = setInterval(() => {
+                  this.account_time--
+                  if (this.account_time <= 0) {
+                    this.sendManagerCode = true
+                    clearInterval(accountTime)
+                  }
+                }, 1000)
+              }
+            } else {
+              return Promise.reject(response.data)
             }
           }).catch(err => {
             this.isShowLoading = false
@@ -583,7 +587,6 @@
           this.$http.post('/appeal/resetPwd', param, config)
             .then(response => {
               if (response.data.success) {
-                this.isShowLoading = false
                 this.goNextStep = false
               } else {
                 this.goNextStep = true

+ 20 - 16
components/appeal/PasswordRestAppeal.vue

@@ -377,21 +377,25 @@
         this.$http.get(`/appeal/check/mobile`, {params: {mobile: this.passwordRest.mobile}})
           .then(response => {
             this.isShowLoading = false
-            this.token = response.data.content.token
-            if (this.token !== '') {
-              this.$message({
-                message: '验证码已经发送到您的手机,请注意查收',
-                type: 'success'
-              })
-              this.sendAccountCode = false
-              this.account_time = 60
-              var accountTime = setInterval(() => {
-                this.account_time--
-                if (this.account_time <= 0) {
-                  this.sendAccountCode = true
-                  clearInterval(accountTime)
-                }
-              }, 1000)
+            if (response.data.success) {
+              this.token = response.data.content.token
+              if (this.token !== '') {
+                this.$message({
+                  message: '验证码已经发送到您的手机,请注意查收',
+                  type: 'success'
+                })
+                this.sendAccountCode = false
+                this.account_time = 60
+                var accountTime = setInterval(() => {
+                  this.account_time--
+                  if (this.account_time <= 0) {
+                    this.sendAccountCode = true
+                    clearInterval(accountTime)
+                  }
+                }, 1000)
+              }
+            } else {
+              return Promise.reject(response.data)
             }
           }).catch(err => {
             this.isShowLoading = false
@@ -416,8 +420,8 @@
           }
           this.$http.post('/appeal/resetPwd', param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.goNextStep = false
 //                待跳转到设置页面
 //                window.loaction.href = ''

+ 1 - 1
components/certification/EnterpriseCertification.vue

@@ -426,8 +426,8 @@
           }
           this.$http.post('/valid/userspace/submit', param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.enterpriseRegister = false
               } else {
                 this.enterpriseRegister = true

+ 2 - 2
components/certification/RealNameCertification.vue

@@ -126,7 +126,7 @@
                     return Promise.reject(response.data)
                   }
                 }).catch(err => {
-//                  this.$message.error(err.errMsg)
+                  this.$message.error(err.errMsg)
                   console.log(err.content.isValid)
                 })
             } else {
@@ -196,8 +196,8 @@
           }
           this.$http.post('/valid/user/identity/submit', param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.goNextStep = false
               } else {
                 this.goNextStep = true

+ 67 - 58
components/change/ChangeManager.vue

@@ -278,47 +278,52 @@
       },
 //      获取验证方式
       getVerifyWay () {
-        this.$http.get('/sso/change/admin/checkType').then(response => {
-          if (response.data.success) {
-            if (!response.data.content) {
-              this.goFirstStep = true
-              this.showManualAppeal = true
-              this.hasValidPhoneWay = false
-              this.hasValidQuestionsWay = false
-              this.hasValidEmailWay = false
-            } else {
-              if (response.data.content.mobile) {
-                this.hasValidPhoneWay = true
-                this.getMobile = response.data.content.mobile
-                var reg = /^(\d{3})\d{6}(\d{2})$/
-                this.secretMobile = this.getMobile.replace(reg, '$1******$2')
-              }
-              if (response.data.content.questions) {
-                this.hasValidQuestionsWay = true
-                this.getQuestions = response.data.content.questions
-                this.question1 = this.getQuestions[0].question || ''
-                this.question2 = this.getQuestions[1].question || ''
-                this.sort1 = this.getQuestions[0].sort || ''
-                this.sort2 = this.getQuestions[1].sort || ''
-              }
-              if (response.data.content.email) {
-                this.hasValidEmailWay = true
-                this.getEmail = response.data.content.email
-                let getEmailIndex = this.getEmail.indexOf('@')
-                if (getEmailIndex > 3) {
-                  let len = this.getEmail.substring(3, getEmailIndex)
-                  this.secretEmail = this.getEmail.replace(len, '*')
-                } else {
-                  this.getEmailArr = this.getEmail.split('')
-                  this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
-                  this.secretEmail = this.getEmailArr.join('')
+        this.$http.get('/sso/change/admin/checkType')
+          .then(response => {
+            if (response.data.success) {
+              if (!response.data.content) {
+                this.goFirstStep = true
+                this.showManualAppeal = true
+                this.hasValidPhoneWay = false
+                this.hasValidQuestionsWay = false
+                this.hasValidEmailWay = false
+              } else {
+                if (response.data.content.mobile) {
+                  this.hasValidPhoneWay = true
+                  this.getMobile = response.data.content.mobile
+                  var reg = /^(\d{3})\d{6}(\d{2})$/
+                  this.secretMobile = this.getMobile.replace(reg, '$1******$2')
                 }
+                if (response.data.content.questions) {
+                  this.hasValidQuestionsWay = true
+                  this.getQuestions = response.data.content.questions
+                  this.question1 = this.getQuestions[0].question || ''
+                  this.question2 = this.getQuestions[1].question || ''
+                  this.sort1 = this.getQuestions[0].sort || ''
+                  this.sort2 = this.getQuestions[1].sort || ''
+                }
+                if (response.data.content.email) {
+                  this.hasValidEmailWay = true
+                  this.getEmail = response.data.content.email
+                  let getEmailIndex = this.getEmail.indexOf('@')
+                  if (getEmailIndex > 3) {
+                    let len = this.getEmail.substring(3, getEmailIndex)
+                    this.secretEmail = this.getEmail.replace(len, '*')
+                  } else {
+                    this.getEmailArr = this.getEmail.split('')
+                    this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
+                    this.secretEmail = this.getEmailArr.join('')
+                  }
+                }
+                this.goFirstStep = true
+                this.showManualAppeal = true
               }
-              this.goFirstStep = true
-              this.showManualAppeal = true
+            } else {
+              return Promise.reject(response.data)
             }
-          }
-        })
+          }).catch(err => {
+            this.$message.error(err.errMsg)
+          })
       },
 //      选择方式
       chooseWay (flag) {
@@ -348,21 +353,25 @@
         this.$http.get(`/sso/change/admin/check/mobile`)
           .then(response => {
             this.isShowLoading = false
-            this.token = response.data.content.token
-            if (this.token !== '') {
-              this.$message({
-                message: '验证码已经发送到您的手机,请注意查收',
-                type: 'success'
-              })
-              this.sendAccountCode = false
-              this.account_time = 60
-              var accountTime = setInterval(() => {
-                this.account_time--
-                if (this.account_time <= 0) {
-                  this.sendAccountCode = true
-                  clearInterval(accountTime)
-                }
-              }, 1000)
+            if (response.data.success) {
+              this.token = response.data.content.token
+              if (this.token !== '') {
+                this.$message({
+                  message: '验证码已经发送到您的手机,请注意查收',
+                  type: 'success'
+                })
+                this.sendAccountCode = false
+                this.account_time = 60
+                var accountTime = setInterval(() => {
+                  this.account_time--
+                  if (this.account_time <= 0) {
+                    this.sendAccountCode = true
+                    clearInterval(accountTime)
+                  }
+                }, 1000)
+              }
+            } else {
+              return Promise.reject(response.data)
             }
           }).catch(err => {
             this.isShowLoading = false
@@ -381,8 +390,8 @@
           }
           this.$http.post(`/sso/change/admin/check/mobile`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content)
                 this.showPhoneValid = false
                 this.$router.push({ path: '/change/changeManagerSecondStep' })
@@ -401,8 +410,8 @@
         this.isShowLoading = true
         this.$http.get(`/sso/change/admin/check/email`)
           .then(response => {
+            this.isShowLoading = false
             if (response.data.success) {
-              this.isShowLoading = false
               this.emailSendSuccess = true
             } else {
               this.emailSendSuccess = false
@@ -410,8 +419,8 @@
             }
           }).catch(err => {
             this.isShowLoading = false
-            console.log(err)
-//          this.$message.error(err.errMsg)
+            // console.log(err)
+            this.$message.error(err.errMsg)
           })
       },
 //      第一步验证密保提交
@@ -428,8 +437,8 @@
           }
           this.$http.post(`/sso/change/admin/check/question`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content.token)
                 this.showQuestionsValid = false
                 this.$router.push({ path: '/change/changeManagerSecondStep' })

+ 21 - 17
components/change/ChangeManagerSecondStep.vue

@@ -208,25 +208,29 @@
         this.$http.get(`/sso/change/admin/check/newMobile`, {params: {mobile: this.valid2.mobile, token: this.firstStepToken}})
           .then(response => {
             this.isShowLoading = false
-            this.secondToken = response.data.content.token
-            if (this.secondToken !== '') {
-              this.$message({
-                message: '验证码已经发送到您的手机,请注意查收',
-                type: 'success'
-              })
-              this.showSecondStepCode = false
-              this.second_step_time = 60
-              var secondStepTime = setInterval(() => {
-                this.second_step_time--
-                if (this.second_step_time <= 0) {
-                  this.showSecondStepCode = true
-                  clearInterval(secondStepTime)
-                }
-              }, 1000)
+            if (response.data.success) {
+              this.secondToken = response.data.content.token
+              if (this.secondToken !== '') {
+                this.$message({
+                  message: '验证码已经发送到您的手机,请注意查收',
+                  type: 'success'
+                })
+                this.showSecondStepCode = false
+                this.second_step_time = 60
+                var secondStepTime = setInterval(() => {
+                  this.second_step_time--
+                  if (this.second_step_time <= 0) {
+                    this.showSecondStepCode = true
+                    clearInterval(secondStepTime)
+                  }
+                }, 1000)
+              }
+            } else {
+              return Promise.reject(response.data)
             }
           }).catch(err => {
             this.isShowLoading = false
-            console.log(err)
+            this.$message.error(err.errMsg)
           })
       },
 //      更换管理员确认
@@ -245,8 +249,8 @@
           }
           this.$http.post(`/sso/change/admin`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$router.push({ path: '/change/changeManagerThirdStep' })
               } else {
                 return Promise.reject(response.data)

+ 56 - 47
components/encrypted-setting/EncryptedSetting.vue

@@ -199,37 +199,42 @@
       },
 //      获取验证方式
       getVerifyWay () {
-        this.$http.get('/update/user/checkType').then(response => {
-          if (response.data.success) {
-            if (!response.data.content.mobile) {
-              this.goValidPhone = true
-            } else {
-              if (response.data.content.mobile) {
-                this.hasValidPhoneWay = true
-                this.showManualAppeal = true
-                this.getMobile = response.data.content.mobile
-                var reg = /^(\d{3})\d{6}(\d{2})$/
-                this.secretMobile = this.getMobile.replace(reg, '$1******$2')
-              }
-              if (response.data.content.email) {
-                this.hasValidEmailWay = true
-                this.showManualAppeal = true
-                this.getEmail = response.data.content.email
-                let getEmailIndex = this.getEmail.indexOf('@')
-                if (getEmailIndex > 3) {
-                  let len = this.getEmail.substring(3, getEmailIndex)
-                  this.secretEmail = this.getEmail.replace(len, '*')
-                } else {
-                  this.getEmailArr = this.getEmail.split('')
-                  this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
-                  this.secretEmail = this.getEmailArr.join('')
+        this.$http.get('/update/user/checkType')
+          .then(response => {
+            if (response.data.success) {
+              if (!response.data.content.mobile) {
+                this.goValidPhone = true
+              } else {
+                if (response.data.content.mobile) {
+                  this.hasValidPhoneWay = true
+                  this.showManualAppeal = true
+                  this.getMobile = response.data.content.mobile
+                  var reg = /^(\d{3})\d{6}(\d{2})$/
+                  this.secretMobile = this.getMobile.replace(reg, '$1******$2')
+                }
+                if (response.data.content.email) {
+                  this.hasValidEmailWay = true
+                  this.showManualAppeal = true
+                  this.getEmail = response.data.content.email
+                  let getEmailIndex = this.getEmail.indexOf('@')
+                  if (getEmailIndex > 3) {
+                    let len = this.getEmail.substring(3, getEmailIndex)
+                    this.secretEmail = this.getEmail.replace(len, '*')
+                  } else {
+                    this.getEmailArr = this.getEmail.split('')
+                    this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
+                    this.secretEmail = this.getEmailArr.join('')
+                  }
                 }
+                this.goValidPhone = false
+                this.goFirstStep = true
               }
-              this.goValidPhone = false
-              this.goFirstStep = true
+            } else {
+              return Promise.reject(response.data)
             }
-          }
-        })
+          }).catch(err => {
+            this.$message.error(err.errMsg)
+          })
       },
 //      没验证手机将跳转到手机验证页面
       goVaildPhoneStep () {
@@ -256,21 +261,25 @@
         this.$http.get(`/update/user/check/mobile`, {params: {mobile: this.getMobile}})
           .then(response => {
             this.isShowLoading = false
-            this.token = response.data.content.token
-            if (this.token !== '') {
-              this.$message({
-                message: '验证码已经发送到您的手机,请注意查收',
-                type: 'success'
-              })
-              this.sendAccountCode = false
-              this.account_time = 60
-              var accountTime = setInterval(() => {
-                this.account_time--
-                if (this.account_time <= 0) {
-                  this.sendAccountCode = true
-                  clearInterval(accountTime)
-                }
-              }, 1000)
+            if (response.data.success) {
+              this.token = response.data.content.token
+              if (this.token !== '') {
+                this.$message({
+                  message: '验证码已经发送到您的手机,请注意查收',
+                  type: 'success'
+                })
+                this.sendAccountCode = false
+                this.account_time = 60
+                var accountTime = setInterval(() => {
+                  this.account_time--
+                  if (this.account_time <= 0) {
+                    this.sendAccountCode = true
+                    clearInterval(accountTime)
+                  }
+                }, 1000)
+              }
+            } else {
+              return Promise.reject(response.data)
             }
           }).catch(err => {
             this.isShowLoading = false
@@ -290,8 +299,8 @@
           }
           this.$http.post(`/update/user/check/mobile`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content)
                 this.showPhoneValid = false
                 this.$router.push({ path: '/encrypted-setting/EncryptedSettingSecondStep' })
@@ -310,8 +319,8 @@
         this.isShowLoading = true
         this.$http.get(`/update/user/check/email`, {params: {email: this.getEmail, operate: 'question'}})
           .then(response => {
+            this.isShowLoading = false
             if (response.data.success) {
-              this.isShowLoading = false
               this.emailSendSuccess = true
             } else {
               this.emailSendSuccess = false
@@ -319,8 +328,8 @@
             }
           }).catch(err => {
             this.isShowLoading = false
-            console.log(err)
-//          this.$message.error(err.errMsg)
+            // console.log(err)
+            this.$message.error(err.errMsg)
           })
       }
     }

+ 1 - 1
components/encrypted-setting/EncryptedSettingSecondStep.vue

@@ -157,8 +157,8 @@
           }
           this.$http.post(`/update/user/setQuestion`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$router.push({ path: '/encrypted-setting/EncryptedSettingThirdStep' })
               } else {
                 return Promise.reject(response.data)

+ 10 - 5
components/login/Login.vue

@@ -123,7 +123,7 @@
             //    获取密码输错次数
             this.$http.get(`/sso/login/getPwdErrorCount`, {params: {username: this.login.username}})
               .then(response => {
-                if (response.data) {
+                if (response.data.success) {
                   this.showCheckCode = false
                   let getPasswordErrorCount = response.data.content || ''
                   if (getPasswordErrorCount >= 5) {
@@ -145,9 +145,12 @@
                     this.checkUsername = false
                     this.showCheckCode = false
                   }
+                } else {
+                  return Promise.reject(response.data)
                 }
-              }, err => {
-                this.$message.error(err)
+              }).catch(err => {
+                this.isShowLoading = false
+                this.$message.error(err.errMsg)
               })
           }
           callback()
@@ -225,6 +228,7 @@
         this.$http.get(`/sso/login/page/style`, {params: {appId: this.appId}})
           .then(response => {
             if (response.data.success) {
+              console.log(response.data.content)
               let logoUrlStyle = response.data.content.logoUrl
               let bgUrl = response.data.content.bgUrl
               let bgColor = response.data.content.bgColor
@@ -242,7 +246,8 @@
               return Promise.reject(response.data)
             }
           }).catch(err => {
-            console.log(err)
+            // console.log(err)
+            this.$message.error(err.errMsg)
           })
       },
 //      忘记密码
@@ -285,8 +290,8 @@
           }
           this.$http.post('/sso/login', param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
 //                console.log(response.data.content)
                 if (response.data.content.spaces) {
 //                   弹框让用户选择企业

+ 23 - 19
components/register/EnterpriseRegistration.vue

@@ -482,22 +482,26 @@
         this.isShowLoading = true
         this.$http.get(`/sso/userspace/register/checkCode`, {params: {mobile: this.enterprise.mobile}})
           .then(response => {
-            this.token = response.data.token
             this.isShowLoading = false
-            if (this.token !== '') {
-              this.$message({
-                message: '验证码已经发送到您的手机,请注意查收',
-                type: 'success'
-              })
-              this.sendEnterpriseCode = false
-              this.enterprise_time = 60
-              var enterpriseTime = setInterval(() => {
-                this.enterprise_time--
-                if (this.enterprise_time <= 0) {
-                  this.sendEnterpriseCode = true
-                  clearInterval(enterpriseTime)
-                }
-              }, 1000)
+            if (response.data.success) {
+              this.token = response.data.token
+              if (this.token !== '') {
+                this.$message({
+                  message: '验证码已经发送到您的手机,请注意查收',
+                  type: 'success'
+                })
+                this.sendEnterpriseCode = false
+                this.enterprise_time = 60
+                var enterpriseTime = setInterval(() => {
+                  this.enterprise_time--
+                  if (this.enterprise_time <= 0) {
+                    this.sendEnterpriseCode = true
+                    clearInterval(enterpriseTime)
+                  }
+                }, 1000)
+              }
+            } else {
+              return Promise.reject(response.data)
             }
           }).catch(err => {
             this.isShowLoading = false
@@ -528,8 +532,8 @@
           }
           this.$http.post('/sso/userspace/register/checkAdminTel', param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.goNextStep = false
                 if (response.data.content.hasRegister) {
                   this.isHasRegister = true
@@ -582,8 +586,8 @@
             }
             this.$http.post('/sso/userspace/register', param, config)
               .then(response => {
+                this.isShowLoading = false
                 if (response.data.success) {
-                  this.isShowLoading = false
                   window.location.href = '/overRegister/overEnterprise'
                 } else {
                   return Promise.reject(response.data)
@@ -609,8 +613,8 @@
               }
               this.$http.post('/sso/userspace/register', param, config)
                 .then(response => {
+                  this.isShowLoading = false
                   if (response.data.success) {
-                    this.isShowLoading = false
                     window.location.href = '/overRegister/overEnterprise'
                   } else {
                     return Promise.reject(response.data)
@@ -635,8 +639,8 @@
               }
               this.$http.post('/sso/userspace/register', param, config)
                 .then(response => {
+                  this.isShowLoading = false
                   if (response.data.success) {
-                    this.isShowLoading = false
                     window.location.href = '/overRegister/overEnterprise'
                   } else {
                     return Promise.reject(response.data)

+ 4 - 4
components/register/EnterpriseRegistrationSecondStep.vue

@@ -87,8 +87,8 @@
                     return Promise.reject(response.data)
                   }
                 }).catch(err => {
-                  console.log(err)
-//                  this.$message.error(err.errMsg)
+                  // console.log(err)
+                  this.$message.error(err.errMsg)
                 })
             }
           }
@@ -119,8 +119,8 @@
                       return Promise.reject(response.data)
                     }
                   }).catch(err => {
-                    console.log(err)
-//                  this.$message.error(err.errMsg)
+                    // console.log(err)
+                    this.$message.error(err.errMsg)
                   })
               }
             } else {

+ 21 - 17
components/register/PersonalRegistration.vue

@@ -332,8 +332,8 @@
           }
           this.$http.post('/sso/personal/register', param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 let userUU = response.data.content.userUU
                 window.location.href = `/overRegister/${userUU}`
               } else {
@@ -359,22 +359,26 @@
         this.$http.get(`/sso/personal/register/checkCode`, {params: {mobile: this.item.mobile}})
           .then(response => {
             this.isShowLoading = false
-            this.token = response.data.token
-            if (this.token !== '') {
-              this.$message({
-                message: '验证码已经发送到您的手机,请注意查收',
-                type: 'success'
-              })
-              this.sendPersonalCode = false
-              this.personal_time = 60
-              var personalTime = setInterval(() => {
-                this.personal_time--
-                if (this.personal_time <= 0) {
-                  this.sendPersonalCode = true
-                  clearInterval(personalTime)
-                }
-              }, 1000)
-            } else {}
+            if (response.data.success) {
+              this.token = response.data.token
+              if (this.token !== '') {
+                this.$message({
+                  message: '验证码已经发送到您的手机,请注意查收',
+                  type: 'success'
+                })
+                this.sendPersonalCode = false
+                this.personal_time = 60
+                var personalTime = setInterval(() => {
+                  this.personal_time--
+                  if (this.personal_time <= 0) {
+                    this.sendPersonalCode = true
+                    clearInterval(personalTime)
+                  }
+                }, 1000)
+              }
+            } else {
+              return Promise.reject(response.data)
+            }
           }).catch(err => {
             this.isShowLoading = false
             this.$message.error(err.errMsg)

+ 56 - 47
components/reset/ChangePasswordChooseStyle.vue

@@ -247,36 +247,41 @@
       },
 //      获取验证方式
       getVerifyWay () {
-        this.$http.get('/sso/resetPwd/checkType/update').then(response => {
-          if (response.data.success) {
-            if (!response.data.content) {
-              this.hasValidPhoneWay = false
-              this.hasValidEmailWay = false
-            } else {
-              if (response.data.content.mobile) {
-                this.hasValidPhoneWay = true
-                this.getMobile = response.data.content.mobile
-                var reg = /^(\d{3})\d{6}(\d{2})$/
-                this.secretMobile = this.getMobile.replace(reg, '$1******$2')
-              }
-              if (response.data.content.email) {
-                this.hasValidEmailWay = true
-                this.getEmail = response.data.content.email
-                let getEmailIndex = this.getEmail.indexOf('@')
-                if (getEmailIndex > 3) {
-                  let len = this.getEmail.substring(3, getEmailIndex)
-                  this.secretEmail = this.getEmail.replace(len, '*')
-                } else {
-                  this.getEmailArr = this.getEmail.split('')
-                  this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
-                  this.secretEmail = this.getEmailArr.join('')
+        this.$http.get('/sso/resetPwd/checkType/update')
+          .then(response => {
+            if (response.data.success) {
+              if (!response.data.content) {
+                this.hasValidPhoneWay = false
+                this.hasValidEmailWay = false
+              } else {
+                if (response.data.content.mobile) {
+                  this.hasValidPhoneWay = true
+                  this.getMobile = response.data.content.mobile
+                  var reg = /^(\d{3})\d{6}(\d{2})$/
+                  this.secretMobile = this.getMobile.replace(reg, '$1******$2')
+                }
+                if (response.data.content.email) {
+                  this.hasValidEmailWay = true
+                  this.getEmail = response.data.content.email
+                  let getEmailIndex = this.getEmail.indexOf('@')
+                  if (getEmailIndex > 3) {
+                    let len = this.getEmail.substring(3, getEmailIndex)
+                    this.secretEmail = this.getEmail.replace(len, '*')
+                  } else {
+                    this.getEmailArr = this.getEmail.split('')
+                    this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
+                    this.secretEmail = this.getEmailArr.join('')
+                  }
                 }
               }
+              this.showManualAppeal = true
+              this.hasValidPasswordWay = true
+            } else {
+              return Promise.reject(response.data)
             }
-            this.showManualAppeal = true
-            this.hasValidPasswordWay = true
-          }
-        })
+          }).catch(err => {
+            this.$message.error(err.errMsg)
+          })
       },
 //      选择方式
       chooseWay (flag) {
@@ -299,21 +304,25 @@
         this.$http.get(`/sso/resetPwd/check/mobile`)
           .then(response => {
             this.isShowLoading = false
-            this.token = response.data.content.token
-            if (this.token !== '') {
-              this.$message({
-                message: '验证码已经发送到您的手机,请注意查收',
-                type: 'success'
-              })
-              this.sendAccountCode = false
-              this.account_time = 60
-              var accountTime = setInterval(() => {
-                this.account_time--
-                if (this.account_time <= 0) {
-                  this.sendAccountCode = true
-                  clearInterval(accountTime)
-                }
-              }, 1000)
+            if (response.data.success) {
+              this.token = response.data.content.token
+              if (this.token !== '') {
+                this.$message({
+                  message: '验证码已经发送到您的手机,请注意查收',
+                  type: 'success'
+                })
+                this.sendAccountCode = false
+                this.account_time = 60
+                var accountTime = setInterval(() => {
+                  this.account_time--
+                  if (this.account_time <= 0) {
+                    this.sendAccountCode = true
+                    clearInterval(accountTime)
+                  }
+                }, 1000)
+              }
+            } else {
+              return Promise.reject(response.data)
             }
           }).catch(err => {
             this.isShowLoading = false
@@ -331,8 +340,8 @@
           }
           this.$http.post(`/sso/resetPwd/check/password`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content.token)
                 this.$router.push({ path: '/reset/passwordResetValidQuestion' })
               } else {
@@ -356,8 +365,8 @@
           }
           this.$http.post(`/sso/resetPwd/check/mobile`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content.token)
                 this.showPhoneValid = false
                 this.$router.push({ path: '/reset/passwordResetValidQuestion' })
@@ -376,8 +385,8 @@
         this.isShowLoading = true
         this.$http.get(`/sso/resetPwd/check/email`)
           .then(response => {
+            this.isShowLoading = false
             if (response.data.success) {
-              this.isShowLoading = false
               this.emailSendSuccess = true
             } else {
               this.emailSendSuccess = false
@@ -385,8 +394,8 @@
             }
           }).catch(err => {
             this.isShowLoading = false
-            console.log(err)
-//          this.$message.error(err.errMsg)
+            // console.log(err)
+            this.$message.error(err.errMsg)
           })
       }
     }

+ 54 - 45
components/reset/ForgetPasswordChooseStyle.vue

@@ -173,35 +173,40 @@
     methods: {
 //      获取验证方式
       getVerifyWay () {
-        this.$http.get('/sso/resetPwd/checkType/reset').then(response => {
-          if (response.data.success) {
-            if (!response.data.content) {
-              this.hasValidPhoneWay = false
-              this.hasValidEmailWay = false
-            } else {
-              if (response.data.content.mobile) {
-                this.hasValidPhoneWay = true
-                this.getMobile = response.data.content.mobile
-                var reg = /^(\d{3})\d{6}(\d{2})$/
-                this.secretMobile = this.getMobile.replace(reg, '$1******$2')
-              }
-              if (response.data.content.email) {
-                this.hasValidEmailWay = true
-                this.getEmail = response.data.content.email
-                let getEmailIndex = this.getEmail.indexOf('@')
-                if (getEmailIndex > 3) {
-                  let len = this.getEmail.substring(3, getEmailIndex)
-                  this.secretEmail = this.getEmail.replace(len, '*')
-                } else {
-                  this.getEmailArr = this.getEmail.split('')
-                  this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
-                  this.secretEmail = this.getEmailArr.join('')
+        this.$http.get('/sso/resetPwd/checkType/reset')
+          .then(response => {
+            if (response.data.success) {
+              if (!response.data.content) {
+                this.hasValidPhoneWay = false
+                this.hasValidEmailWay = false
+              } else {
+                if (response.data.content.mobile) {
+                  this.hasValidPhoneWay = true
+                  this.getMobile = response.data.content.mobile
+                  var reg = /^(\d{3})\d{6}(\d{2})$/
+                  this.secretMobile = this.getMobile.replace(reg, '$1******$2')
+                }
+                if (response.data.content.email) {
+                  this.hasValidEmailWay = true
+                  this.getEmail = response.data.content.email
+                  let getEmailIndex = this.getEmail.indexOf('@')
+                  if (getEmailIndex > 3) {
+                    let len = this.getEmail.substring(3, getEmailIndex)
+                    this.secretEmail = this.getEmail.replace(len, '*')
+                  } else {
+                    this.getEmailArr = this.getEmail.split('')
+                    this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
+                    this.secretEmail = this.getEmailArr.join('')
+                  }
                 }
               }
+              this.showManualAppeal = true
+            } else {
+              return Promise.reject(response.data)
             }
-            this.showManualAppeal = true
-          }
-        })
+          }).catch(err => {
+            this.$message.error(err.errMsg)
+          })
       },
 //      选择方式
       chooseWay (flag) {
@@ -224,21 +229,25 @@
         this.$http.get(`/sso/resetPwd/check/mobile`)
           .then(response => {
             this.isShowLoading = false
-            this.token = response.data.content.token
-            if (this.token !== '') {
-              this.$message({
-                message: '验证码已经发送到您的手机,请注意查收',
-                type: 'success'
-              })
-              this.sendAccountCode = false
-              this.account_time = 60
-              var accountTime = setInterval(() => {
-                this.account_time--
-                if (this.account_time <= 0) {
-                  this.sendAccountCode = true
-                  clearInterval(accountTime)
-                }
-              }, 1000)
+            if (response.data.success) {
+              this.token = response.data.content.token
+              if (this.token !== '') {
+                this.$message({
+                  message: '验证码已经发送到您的手机,请注意查收',
+                  type: 'success'
+                })
+                this.sendAccountCode = false
+                this.account_time = 60
+                var accountTime = setInterval(() => {
+                  this.account_time--
+                  if (this.account_time <= 0) {
+                    this.sendAccountCode = true
+                    clearInterval(accountTime)
+                  }
+                }, 1000)
+              }
+            } else {
+              return Promise.reject(response.data)
             }
           }).catch(err => {
             this.isShowLoading = false
@@ -257,8 +266,8 @@
           }
           this.$http.post(`/sso/resetPwd/check/mobile`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content.token)
                 this.showPhoneValid = false
                 this.$router.push({ path: '/reset/passwordResetValidQuestion' })
@@ -277,8 +286,8 @@
         this.isShowLoading = true
         this.$http.get(`/sso/resetPwd/check/email`)
           .then(response => {
+            this.isShowLoading = false
             if (response.data.success) {
-              this.isShowLoading = false
               this.emailSendSuccess = true
             } else {
               this.emailSendSuccess = false
@@ -286,8 +295,8 @@
             }
           }).catch(err => {
             this.isShowLoading = false
-            console.log(err)
-//          this.$message.error(err.errMsg)
+            // console.log(err)
+            this.$message.error(err.errMsg)
           })
       }
     }

+ 1 - 1
components/reset/ForgetPasswordValidationAccount.vue

@@ -96,8 +96,8 @@
           }
           this.$http.post(`/sso/resetPwd/checkCaptcha`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$router.push({ path: '/reset/forgetPasswordChooseStyle' })
               } else {
                 this.changeCaptcha()

+ 1 - 1
components/reset/PasswordResetNewPassword.vue

@@ -189,8 +189,8 @@
           }
           this.$http.post(`/sso/resetPwd`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$router.push({ path: '/reset/passwordResetSetSuccess' })
               } else {
                 return Promise.reject(response.data)

+ 1 - 1
components/reset/PasswordResetValidQuestion.vue

@@ -164,8 +164,8 @@
           }
           this.$http.post(`/sso/resetPwd/check/question`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content.token)
                 this.$router.push({ path: '/reset/passwordResetNewPassword' })
               } else {

+ 66 - 57
components/validation/EmailValidation.vue

@@ -290,46 +290,51 @@
       },
 //      获取验证方式
       getVerifyWay () {
-        this.$http.get('/update/user/checkType').then(response => {
-          if (response.data.success) {
-            if (!response.data.content.mobile) {
-              this.goValidPhone = true
-            } else {
-              if (response.data.content.mobile) {
-                this.hasValidPhoneWay = true
-                this.showManualAppeal = true
-                this.getMobile = response.data.content.mobile
-                var reg = /^(\d{3})\d{6}(\d{2})$/
-                this.secretMobile = this.getMobile.replace(reg, '$1******$2')
-              }
-              if (response.data.content.questions) {
-                this.hasValidQuestionsWay = true
-                this.showManualAppeal = true
-                this.getQuestions = response.data.content.questions
-                this.question1 = this.getQuestions[0].question || ''
-                this.question2 = this.getQuestions[1].question || ''
-                this.sort1 = this.getQuestions[0].sort || ''
-                this.sort2 = this.getQuestions[1].sort || ''
-              }
-              if (response.data.content.email) {
-                this.hasValidEmailWay = true
-                this.showManualAppeal = true
-                this.getEmail = response.data.content.email
-                let getEmailIndex = this.getEmail.indexOf('@')
-                if (getEmailIndex > 3) {
-                  let len = this.getEmail.substring(3, getEmailIndex)
-                  this.secretEmail = this.getEmail.replace(len, '*')
-                } else {
-                  this.getEmailArr = this.getEmail.split('')
-                  this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
-                  this.secretEmail = this.getEmailArr.join('')
+        this.$http.get('/update/user/checkType')
+          .then(response => {
+            if (response.data.success) {
+              if (!response.data.content.mobile) {
+                this.goValidPhone = true
+              } else {
+                if (response.data.content.mobile) {
+                  this.hasValidPhoneWay = true
+                  this.showManualAppeal = true
+                  this.getMobile = response.data.content.mobile
+                  var reg = /^(\d{3})\d{6}(\d{2})$/
+                  this.secretMobile = this.getMobile.replace(reg, '$1******$2')
                 }
+                if (response.data.content.questions) {
+                  this.hasValidQuestionsWay = true
+                  this.showManualAppeal = true
+                  this.getQuestions = response.data.content.questions
+                  this.question1 = this.getQuestions[0].question || ''
+                  this.question2 = this.getQuestions[1].question || ''
+                  this.sort1 = this.getQuestions[0].sort || ''
+                  this.sort2 = this.getQuestions[1].sort || ''
+                }
+                if (response.data.content.email) {
+                  this.hasValidEmailWay = true
+                  this.showManualAppeal = true
+                  this.getEmail = response.data.content.email
+                  let getEmailIndex = this.getEmail.indexOf('@')
+                  if (getEmailIndex > 3) {
+                    let len = this.getEmail.substring(3, getEmailIndex)
+                    this.secretEmail = this.getEmail.replace(len, '*')
+                  } else {
+                    this.getEmailArr = this.getEmail.split('')
+                    this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
+                    this.secretEmail = this.getEmailArr.join('')
+                  }
+                }
+                this.goValidPhone = false
+                this.goFirstStep = true
               }
-              this.goValidPhone = false
-              this.goFirstStep = true
+            } else {
+              return Promise.reject(response.data)
             }
-          }
-        })
+          }).catch(err => {
+            this.$message.error(err.errMsg)
+          })
       },
 //      没验证手机将跳转到手机验证页面
       goVaildPhoneStep () {
@@ -363,21 +368,25 @@
         this.$http.get(`/update/user/check/mobile`, {params: {mobile: this.getMobile}})
           .then(response => {
             this.isShowLoading = false
-            this.token = response.data.content.token
-            if (this.token !== '') {
-              this.$message({
-                message: '验证码已经发送到您的手机,请注意查收',
-                type: 'success'
-              })
-              this.sendAccountCode = false
-              this.account_time = 60
-              var accountTime = setInterval(() => {
-                this.account_time--
-                if (this.account_time <= 0) {
-                  this.sendAccountCode = true
-                  clearInterval(accountTime)
-                }
-              }, 1000)
+            if (response.data.success) {
+              this.token = response.data.content.token
+              if (this.token !== '') {
+                this.$message({
+                  message: '验证码已经发送到您的手机,请注意查收',
+                  type: 'success'
+                })
+                this.sendAccountCode = false
+                this.account_time = 60
+                var accountTime = setInterval(() => {
+                  this.account_time--
+                  if (this.account_time <= 0) {
+                    this.sendAccountCode = true
+                    clearInterval(accountTime)
+                  }
+                }, 1000)
+              }
+            } else {
+              return Promise.reject(response.data)
             }
           }).catch(err => {
             this.isShowLoading = false
@@ -397,8 +406,8 @@
           }
           this.$http.post(`/update/user/check/mobile`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content)
                 this.showPhoneValid = false
                 this.$router.push({ path: '/validation/emailValidationSecondStep' })
@@ -417,8 +426,8 @@
         this.isShowLoading = true
         this.$http.get(`/update/user/check/email`, {params: {email: this.getEmail, operate: 'email'}})
           .then(response => {
+            this.isShowLoading = false
             if (response.data.success) {
-              this.isShowLoading = false
               this.emailSendSuccess = true
             } else {
               this.emailSendSuccess = false
@@ -426,8 +435,8 @@
             }
           }).catch(err => {
             this.isShowLoading = false
-            console.log(err)
-//          this.$message.error(err.errMsg)
+            // console.log(err)
+            this.$message.error(err.errMsg)
           })
       },
 //      第一步验证密保提交
@@ -444,8 +453,8 @@
           }
           this.$http.post(`/update/user/check/question`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content.token)
                 this.showQuestionsValid = false
                 this.$router.push({ path: '/validation/emailValidationSecondStep' })

+ 3 - 3
components/validation/EmailValidationSecondStep.vue

@@ -91,8 +91,8 @@
           this.isShowLoading = true
           this.$http.get(`/update/user/setEmail`, {params: {email: this.valid2.email, token: this.firstStepToken}})
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.sendEmailSuccess = true
               } else {
                 this.sendEmailSuccess = false
@@ -100,8 +100,8 @@
               }
             }).catch(err => {
               this.isShowLoading = false
-              console.log(err)
-//                  this.$message.error(err.errMsg)
+              // console.log(err)
+              this.$message.error(err.errMsg)
             })
         }
       },

+ 65 - 55
components/validation/PhoneValidation.vue

@@ -140,6 +140,7 @@
           callback(new Error('请填写正确的验证码'))
           this.codeErrorChecked = false
           this.codeChecked = false
+          console.log(this.codeChecked)
         } else {
           if (this.valid.code !== '') {
             if (this.token) {
@@ -278,45 +279,50 @@
       },
 //      获取验证方式
       getVerifyWay () {
-        this.$http.get('/update/user/checkType').then(response => {
-          if (response.data.success) {
-            if (!response.data.content) {
-              this.showManualAppeal = true
-            } else {
-              if (response.data.content.mobile) {
-                this.hasValidPhoneWay = true
-                this.showManualAppeal = true
-                this.getMobile = response.data.content.mobile
-                var reg = /^(\d{3})\d{6}(\d{2})$/
-                this.secretMobile = this.getMobile.replace(reg, '$1******$2')
-              }
-              if (response.data.content.questions) {
-                this.hasValidQuestionsWay = true
-                this.showManualAppeal = true
-                this.getQuestions = response.data.content.questions
-                this.question1 = this.getQuestions[0].question || ''
-                this.question2 = this.getQuestions[1].question || ''
-                this.sort1 = this.getQuestions[0].sort || ''
-                this.sort2 = this.getQuestions[1].sort || ''
-              }
-              if (response.data.content.email) {
-                this.hasValidEmailWay = true
+        this.$http.get('/update/user/checkType')
+          .then(response => {
+            if (response.data.success) {
+              if (!response.data.content) {
                 this.showManualAppeal = true
-                this.getEmail = response.data.content.email
-                let getEmailIndex = this.getEmail.indexOf('@')
-                if (getEmailIndex > 3) {
-                  let len = this.getEmail.substring(3, getEmailIndex)
-                  this.secretEmail = this.getEmail.replace(len, '*')
-                } else {
-                  this.getEmailArr = this.getEmail.split('')
-                  this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
-                  this.secretEmail = this.getEmailArr.join('')
+              } else {
+                if (response.data.content.mobile) {
+                  this.hasValidPhoneWay = true
+                  this.showManualAppeal = true
+                  this.getMobile = response.data.content.mobile
+                  var reg = /^(\d{3})\d{6}(\d{2})$/
+                  this.secretMobile = this.getMobile.replace(reg, '$1******$2')
+                }
+                if (response.data.content.questions) {
+                  this.hasValidQuestionsWay = true
+                  this.showManualAppeal = true
+                  this.getQuestions = response.data.content.questions
+                  this.question1 = this.getQuestions[0].question || ''
+                  this.question2 = this.getQuestions[1].question || ''
+                  this.sort1 = this.getQuestions[0].sort || ''
+                  this.sort2 = this.getQuestions[1].sort || ''
+                }
+                if (response.data.content.email) {
+                  this.hasValidEmailWay = true
+                  this.showManualAppeal = true
+                  this.getEmail = response.data.content.email
+                  let getEmailIndex = this.getEmail.indexOf('@')
+                  if (getEmailIndex > 3) {
+                    let len = this.getEmail.substring(3, getEmailIndex)
+                    this.secretEmail = this.getEmail.replace(len, '*')
+                  } else {
+                    this.getEmailArr = this.getEmail.split('')
+                    this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
+                    this.secretEmail = this.getEmailArr.join('')
+                  }
                 }
+                this.goFirstStep = true
               }
-              this.goFirstStep = true
+            } else {
+              return Promise.reject(response.data)
             }
-          }
-        })
+          }).catch(err => {
+            this.$message.error(err.errMsg)
+          })
       },
 //      选择方式
       chooseWay (flag) {
@@ -346,21 +352,25 @@
         this.$http.get(`/update/user/check/mobile`, {params: {mobile: this.getMobile}})
           .then(response => {
             this.isShowLoading = false
-            this.token = response.data.content.token
-            if (this.token !== '') {
-              this.$message({
-                message: '验证码已经发送到您的手机,请注意查收',
-                type: 'success'
-              })
-              this.sendAccountCode = false
-              this.account_time = 60
-              var accountTime = setInterval(() => {
-                this.account_time--
-                if (this.account_time <= 0) {
-                  this.sendAccountCode = true
-                  clearInterval(accountTime)
-                }
-              }, 1000)
+            if (response.data.success) {
+              this.token = response.data.content.token
+              if (this.token !== '') {
+                this.$message({
+                  message: '验证码已经发送到您的手机,请注意查收',
+                  type: 'success'
+                })
+                this.sendAccountCode = false
+                this.account_time = 60
+                var accountTime = setInterval(() => {
+                  this.account_time--
+                  if (this.account_time <= 0) {
+                    this.sendAccountCode = true
+                    clearInterval(accountTime)
+                  }
+                }, 1000)
+              }
+            } else {
+              return Promise.reject(response.data)
             }
           }).catch(err => {
             this.isShowLoading = false
@@ -380,8 +390,8 @@
           }
           this.$http.post(`/update/user/check/mobile`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content)
                 this.showPhoneValid = false
                 this.$router.push({ path: '/validation/phoneValidationSecondStep' })
@@ -400,8 +410,8 @@
         this.isShowLoading = true
         this.$http.get(`/update/user/check/email`, {params: {email: this.getEmail, operate: 'mobile'}})
           .then(response => {
+            this.isShowLoading = false
             if (response.data.success) {
-              this.isShowLoading = false
               this.emailSendSuccess = true
             } else {
               this.emailSendSuccess = false
@@ -409,8 +419,8 @@
             }
           }).catch(err => {
             this.isShowLoading = false
-            console.log(err)
-//          this.$message.error(err.errMsg)
+            // console.log(err)
+            this.$message.error(err.errMsg)
           })
       },
 //      第一步验证密保提交
@@ -427,8 +437,8 @@
           }
           this.$http.post(`/update/user/check/question`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content.token)
                 this.showQuestionsValid = false
                 this.$router.push({ path: '/validation/phoneValidationSecondStep' })

+ 22 - 17
components/validation/PhoneValidationSecondStep.vue

@@ -151,28 +151,33 @@
 //      获取第二步手机验证码
       getSecondCheckCode () {
         this.isShowLoading = true
+        console.log(this.isShowLoading)
         this.$http.get(`/update/user/setMobile`, {params: {mobile: this.valid2.mobile, token: this.firstStepToken}})
           .then(response => {
             this.isShowLoading = false
-            this.secondToken = response.data.content.token
-            if (this.secondToken !== '') {
-              this.$message({
-                message: '验证码已经发送到您的手机,请注意查收',
-                type: 'success'
-              })
-              this.showSecondStepCode = false
-              this.second_step_time = 60
-              var secondStepTime = setInterval(() => {
-                this.second_step_time--
-                if (this.second_step_time <= 0) {
-                  this.showSecondStepCode = true
-                  clearInterval(secondStepTime)
-                }
-              }, 1000)
+            if (response.data.success) {
+              this.secondToken = response.data.content.token
+              if (this.secondToken !== '') {
+                this.$message({
+                  message: '验证码已经发送到您的手机,请注意查收',
+                  type: 'success'
+                })
+                this.showSecondStepCode = false
+                this.second_step_time = 60
+                var secondStepTime = setInterval(() => {
+                  this.second_step_time--
+                  if (this.second_step_time <= 0) {
+                    this.showSecondStepCode = true
+                    clearInterval(secondStepTime)
+                  }
+                }, 1000)
+              }
+            } else {
+              return Promise.reject(response.data)
             }
           }).catch(err => {
             this.isShowLoading = false
-            console.log(err)
+            this.$message.error(err.errMsg)
           })
       },
 //      设置新手机号
@@ -188,8 +193,8 @@
           }
           this.$http.post(`/update/user/setMobile`, param, config)
             .then(response => {
+              this.isShowLoading = false
               if (response.data.success) {
-                this.isShowLoading = false
                 this.$router.push({ path: '/validation/phoneValidationThirdStep' })
               } else {
                 return Promise.reject(response.data)