mirror of
https://github.com/chillzhuang/Saber.git
synced 2024-11-22 10:29:28 +08:00
🎉 优化登录逻辑
This commit is contained in:
parent
af6536003e
commit
d762826a23
@ -40,7 +40,7 @@ const user = {
|
|||||||
actions: {
|
actions: {
|
||||||
//根据用户名登录
|
//根据用户名登录
|
||||||
LoginByUsername({ commit }, userInfo) {
|
LoginByUsername({ commit }, userInfo) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve, reject) => {
|
||||||
loginByUsername(userInfo.tenantCode, userInfo.username, userInfo.password, userInfo.type).then(res => {
|
loginByUsername(userInfo.tenantCode, userInfo.username, userInfo.password, userInfo.type).then(res => {
|
||||||
const data = res.data.data;
|
const data = res.data.data;
|
||||||
commit('SET_TOKEN', data.accessToken);
|
commit('SET_TOKEN', data.accessToken);
|
||||||
@ -48,6 +48,8 @@ const user = {
|
|||||||
commit('DEL_ALL_TAG');
|
commit('DEL_ALL_TAG');
|
||||||
commit('CLEAR_LOCK');
|
commit('CLEAR_LOCK');
|
||||||
resolve();
|
resolve();
|
||||||
|
}).catch(error => {
|
||||||
|
reject(error);
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user