Jelajahi Sumber

fix 绑定邮箱bug

guo00guo 5 tahun lalu
induk
melakukan
afa1063eff
1 mengubah file dengan 20 tambahan dan 8 penghapusan
  1. 20 8
      src/pages/UserCenter/ReBindingMail.vue

+ 20 - 8
src/pages/UserCenter/ReBindingMail.vue

@@ -48,14 +48,26 @@
           "email": this.emailBindingForm.email,
           "verifyCode": this.emailBindingForm.verifyCode
         };
-        Http.put('/api/user/email', params).then(res => {
-          if (res.msg !== 'ERROR') {
-            notify('success', '重新绑定成功');
-            // this.$router.push({path: '/personal/mailBinding'});
-            window.location.href({path: '/personal/mailBinding'});
-          }
-        }).catch(err => {
-          notify('error', '重新绑定失败:' + err.data);
+        // Http.put('/api/user/email', params).then(res => {
+        //   if (res.msg !== 'ERROR') {
+        //     notify('success', '重新绑定成功');
+        //     // this.$router.push({path: '/personal/mailBinding'});
+        //     window.location.href({path: '/personal/mailBinding'});
+        //   }
+        // }).catch(err => {
+        //   notify('error', '重新绑定失败:' + err.data);
+        // })
+
+        if(this.emailBindingForm.email == this.user.email){
+            notify('error', '请使用其他邮箱,此邮箱您已绑定!');
+        }
+        Http.put('/api/user/email', params).then((res) => {
+            if(res.msg == "ERROR"){
+                notify('error', '重新绑定失败:' + res.data);
+            }else{
+                notify('success', '重新绑定成功');
+                window.location.href({path: '/personal/mine'});
+            }
         })
       },
       getVerifyCode() {