seimin 1 рік тому
батько
коміт
dc2f132211
1 змінених файлів з 13 додано та 5 видалено
  1. 13 5
      src/views/Login.vue

+ 13 - 5
src/views/Login.vue

@@ -110,9 +110,11 @@ export default {
110
               },
110
               },
111
               onConfirm: (e, promptValue) => {
111
               onConfirm: (e, promptValue) => {
112
                 console.log(e, promptValue);
112
                 console.log(e, promptValue);
113
-                that.$http.post("service/auth/bindAccount", {account:promptValue,wechat:res.data.wechat}).then(res1=>{
114
-                  if(res1.data.status == 403){
115
-                    that
113
+                that.$http.post("service/auth/bindAccount", {account:promptValue,wechat:res.data.wechat,type:'bind'}).then(res1=>{
114
+                  if(res1.data.status == 200){
115
+                      that.login();
116
+                  }else if(res1.data.status == 401 || res1.data.status == 403){
117
+                      that
116
                       .$createDialog({
118
                       .$createDialog({
117
                         type: "alert",
119
                         type: "alert",
118
                         title: '请联系管理员进行添加',
120
                         title: '请联系管理员进行添加',
@@ -120,7 +122,13 @@ export default {
120
                       })
122
                       })
121
                       .show();
123
                       .show();
122
                   }else{
124
                   }else{
123
-                     that.login();
125
+                     that
126
+                      .$createDialog({
127
+                        type: "alert",
128
+                        title: res.data.msg || '请求数据失败!',
129
+                        icon: "cubeic-alert"
130
+                      })
131
+                      .show();
124
                   }
132
                   }
125
                 })
133
                 })
126
               }
134
               }
@@ -129,7 +137,7 @@ export default {
129
             that
137
             that
130
               .$createDialog({
138
               .$createDialog({
131
                 type: "alert",
139
                 type: "alert",
132
-                title: res.data.remarks,
140
+                title: res.data.remarks || '请求数据失败!',
133
                 icon: "cubeic-alert"
141
                 icon: "cubeic-alert"
134
               })
142
               })
135
               .show();
143
               .show();