add logout
This commit is contained in:
parent
24f091ac79
commit
9ba45c37c2
@ -274,11 +274,20 @@ export class QueryLogin {
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 退出登陆,去掉token, 并删除缓存
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
async logout() {
|
async logout() {
|
||||||
this.storage.removeItem('token');
|
this.storage.removeItem('token');
|
||||||
|
const users = await this.cache.getCurrentUserList();
|
||||||
|
const tokens = users
|
||||||
|
.map((user) => {
|
||||||
|
return user?.accessToken;
|
||||||
|
})
|
||||||
|
.filter(Boolean);
|
||||||
this.cache.del();
|
this.cache.del();
|
||||||
return this.post<Result>({ key: 'logout' });
|
return this.post<Result>({ key: 'logout', data: { tokens } });
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 检查用户名的组,这个用户是否存在
|
* 检查用户名的组,这个用户是否存在
|
||||||
|
Loading…
x
Reference in New Issue
Block a user