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

* feat: 用户登录使用mock api, 可以使用test用户登录

* Update permission.ts
This commit is contained in:
tomoat
2022-04-07 22:47:33 +08:00
committed by GitHub
parent bafd9522e0
commit 0becf0b4bc
5 changed files with 48 additions and 14 deletions

View File

@@ -61,8 +61,11 @@ 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<void>((resolve, reject) => {
return new Promise((resolve, reject) => {
getLogin(data)
.then(data => {
if (data) {
setToken(data);
resolve();
.then(res => {
if (res) {
setToken(res);
resolve(res);
}
})
.catch(error => {