From d762826a23ce44f0519cc0513bab09c905d3d5f8 Mon Sep 17 00:00:00 2001 From: smallchill Date: Sun, 14 Jul 2019 19:54:09 +0800 Subject: [PATCH] =?UTF-8?q?:tada:=20=E4=BC=98=E5=8C=96=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/user.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 7e12fe3..420eee4 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -40,7 +40,7 @@ const user = { actions: { //根据用户名登录 LoginByUsername({ commit }, userInfo) { - return new Promise((resolve) => { + return new Promise((resolve, reject) => { loginByUsername(userInfo.tenantCode, userInfo.username, userInfo.password, userInfo.type).then(res => { const data = res.data.data; commit('SET_TOKEN', data.accessToken); @@ -48,6 +48,8 @@ const user = { commit('DEL_ALL_TAG'); commit('CLEAR_LOCK'); resolve(); + }).catch(error => { + reject(error); }) }) },