Browse Source

完成密码重置功能

Administrator 7 years ago
parent
commit
08388b5e58

+ 1 - 1
components/mobile/reset/stepAppeal.vue

@@ -316,7 +316,7 @@
             this.$indicator.open('验证过程中...')
             let param = new FormData()
             param.append('mobile', this.valid.mobile)
-            param.append('code', this.valid.code)
+            param.append('code', this.valid.token)
             param.append('password', this.valid.password)
             param.append('description', this.valid.description)
             param.append('contactName', this.valid.contactName)

+ 7 - 5
components/mobile/reset/stepSecurity .vue

@@ -86,13 +86,15 @@
             if (response.data.success) {
               this.questions = response.data.content.questions
               this.token = response.data.content.token
+              if (this.questions.length === 0) {
+                this.$emit('stepEvent', 'new')
+              }
             } else {
               this.downToast(response.data.errMsg)
             }
           })
       },
       sureAccount (type) {
-        // this.$emit('stepEvent', type)
         if (this.state.answer1 !== 'success' && this.state.answer2 !== 'success') {
           this.downToast('请确认填写部分是否有误')
         } else {
@@ -112,13 +114,13 @@
           }
           this.$http.post(`/sso/resetPwd/check/question`, param, config)
             .then(response => {
-              this.isShowLoading = false
+              this.$indicator.close()
               if (response.data.success) {
                 console.log(response.data, type)
-                // this.$store.commit('login/GET_TOKEN', response.data.content.token)
-                // this.$router.push({ path: '/reset/passwordResetNewPassword' })
+                this.$emit('stepEvent', type)
+                this.$emit('tokenEvent', response.data.content.token)
               } else {
-                return Promise.reject(response.data)
+                this.downToast(response.data.errMsg)
               }
             }).catch(() => {
               this.$indicator.close()

+ 4 - 2
pages/reset/forgetPasswordValidationAccount.vue

@@ -7,7 +7,7 @@
       <step-email v-if="step === 'email'" @stepEvent="setStep" :info="info"/>
       <step-mobile v-if="step === 'mobile'" @stepEvent="setStep" @tokenEvent="loadToken" :info="info"/>
       <step-appeal v-if="step === 'appeal'" @stepEvent="setStep" @lastEvent="setStepLast"/>
-      <step-security v-if="step === 'security'" @stepEvent="setStep" :tokenId="tokenId"/>
+      <step-security v-if="step === 'security'" @stepEvent="setStep" @tokenEvent="loadToken" :tokenId="tokenId"/>
       <step-new v-if="step === 'new'" @stepEvent="setStep" @lastEvent="setStepLast" :stepLast="stepLast" :tokenId="tokenId"/>
       <step-Last v-if="step === 'last'" @stepEvent="setStep" :stepLast="stepLast"/>
     </template>
@@ -52,9 +52,11 @@
     },
     mounted () {
       if (this.$route.query.token) {
-        this.step = 'new'
+        this.step = 'security'
       } else if (this.$store.state.option.isLogin.data.content.isLogin) {
         this.step = 'select'
+      } else {
+        this.step = 'first'
       }
     },
     computed: {