Browse Source

绑定工号修改

seimin 1 year ago
parent
commit
dc2f132211
1 changed files with 13 additions and 5 deletions
  1. 13 5
      src/views/Login.vue

+ 13 - 5
src/views/Login.vue

@@ -110,9 +110,11 @@ export default {
110 110
               },
111 111
               onConfirm: (e, promptValue) => {
112 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 118
                       .$createDialog({
117 119
                         type: "alert",
118 120
                         title: '请联系管理员进行添加',
@@ -120,7 +122,13 @@ export default {
120 122
                       })
121 123
                       .show();
122 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 137
             that
130 138
               .$createDialog({
131 139
                 type: "alert",
132
-                title: res.data.remarks,
140
+                title: res.data.remarks || '请求数据失败!',
133 141
                 icon: "cubeic-alert"
134 142
               })
135 143
               .show();