guhongwei 4 years ago
parent
commit
31ba08e6db
1 changed files with 10 additions and 1 deletions
  1. 10 1
      src/views/bind/bind.vue

+ 10 - 1
src/views/bind/bind.vue

@@ -46,9 +46,18 @@ export default {
     async onSubmit(form) {
       form.openid = this.openid;
       let res = await this.bind(form);
-      if (this.$checkRes(res, `绑定成功`)) {
+      if (res.errcode === 0) {
+        this.$notify({
+          message: '绑定成功',
+          type: 'success',
+        });
         sessionStorage.setItem('user', JSON.stringify(res.data));
         window.history.replaceState({}, '首页', `${Vue.config.weixin.baseUrl}/api/train/auth?redirect_uri=${Vue.config.weixin.target}/login&type=0`);
+      } else {
+        this.$notify({
+          message: '绑定失败',
+          type: 'error',
+        });
       }
     },
   },