mirror of
https://github.com/chillzhuang/Saber.git
synced 2024-11-22 02:19:32 +08:00
🎉 优化登录逻辑
This commit is contained in:
parent
af6536003e
commit
d762826a23
@ -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);
|
||||
})
|
||||
})
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user