Переглянути джерело

增加新邮箱时判断跳转页面

hangb 7 роки тому
батько
коміт
01edf17904

+ 53 - 0
components/validation/EmailStepJump.vue

@@ -0,0 +1,53 @@
+<template>
+  <div class="validation">
+    <div class="jump">
+      <loading/>
+      <p>跳转中,请稍后...</p>
+    </div>
+  </div>
+</template>
+
+<script>
+  import Loading from '~components/common/loading/Loading.vue'
+  export default {
+    name: 'validation',
+    props: ['tokenId'],
+    components: {
+      Loading
+    },
+    mounted () {
+      this.$nextTick(() => {
+        this.jump()
+      })
+    },
+    methods: {
+      jump () {
+        this.$http.get(`/update/user/email`, {params: {token: this.$route.query.token ? this.$route.query.token : this.tokenId}})
+          .then(response => {
+            if (response.data.success) {
+              this.$emit('stepEvent', 'last')
+            } else {
+              this.$emit('stepEvent', 'fail')
+              return Promise.reject(response.data)
+            }
+          }).catch(err => {
+            this.$message.error(err.errMsg)
+          })
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .jump{
+    p{
+      position: fixed;
+      left: 0;
+      right:0;
+      top: 54%;
+      z-index: 1000;
+      text-align: center;
+      font-size: 14px;
+      color:#333;
+    }
+  }
+</style>

+ 1 - 0
components/validation/index.js

@@ -9,6 +9,7 @@ import EmailStepMobile from './EmailStepMobile.vue'
 import EmailStepEmail from './EmailStepEmail.vue'
 import EmailStepSecurity from './EmailStepSecurity.vue'
 import EmailStepNew from './EmailStepNew.vue'
+// import EmailStepJump from './EmailStepJump.vue'
 import EmailStepSuccess from './EmailStepSuccess.vue'
 import ValidationFail from './ValidationFail.vue'