Revert "feat: 用户登录使用mock api, 可以使用test用户登录 (#233)"

This commit is contained in:
xiaoxian521
2022-04-10 20:32:18 +08:00
parent dc219ed11a
commit 91df7349f4
5 changed files with 14 additions and 48 deletions

View File

@@ -61,11 +61,8 @@ export const usePermissionStore = defineStore({
break;
}
},
// 清空缓存
// 清空缓存页面
clearAllCachePage() {
this.wholeMenus = [];
this.menusTree = [];
this.buttonAuth = [];
this.cachePageList = [];
}
}

View File

@@ -33,12 +33,12 @@ export const useUserStore = defineStore({
},
// 登入
async loginByUsername(data) {
return new Promise((resolve, reject) => {
return new Promise<void>((resolve, reject) => {
getLogin(data)
.then(res => {
if (res) {
setToken(res);
resolve(res);
.then(data => {
if (data) {
setToken(data);
resolve();
}
})
.catch(error => {