xiongzhu hace 4 años
padre
commit
3ab347299e
Se han modificado 1 ficheros con 10 adiciones y 5 borrados
  1. 10 5
      src/views/asset/Consignment.vue

+ 10 - 5
src/views/asset/Consignment.vue

@@ -167,8 +167,15 @@ export default {
                             message: '加载中...',
                             forbidClick: true
                         });
-                        return this.$http.post('/user/verifyTradeCode', {
-                            tradeCode: this.password
+                        return new Promise((resolve, reject) => {
+                            this.$http
+                                .post('/user/verifyTradeCode', {
+                                    tradeCode: this.password
+                                })
+                                .then(_ => resolve())
+                                .catch(e => {
+                                    reject({ error: '密码错误' });
+                                });
                         });
                     })
                     .then(() => {
@@ -178,9 +185,7 @@ export default {
                         });
                     })
                     .catch(e => {
-                        if (e && e.error) {
-                            this.$toast('密码错误');
-                        }
+                        this.$toast(e.error || '出现错误,请稍后再试');
                         return Promise.reject('cancel');
                     })
                     .then(res => {