🎉 优化登录逻辑

This commit is contained in:
smallchill 2019-07-14 19:54:09 +08:00
parent af6536003e
commit d762826a23
1 changed files with 3 additions and 1 deletions

View File

@ -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);
})
})
},