add logout

This commit is contained in:
熊潇 2025-03-23 02:59:25 +08:00
parent 24f091ac79
commit 9ba45c37c2

View File

@ -274,11 +274,20 @@ export class QueryLogin {
}
return res;
}
/**
* 退token
* @returns
*/
async logout() {
this.storage.removeItem('token');
const users = await this.cache.getCurrentUserList();
const tokens = users
.map((user) => {
return user?.accessToken;
})
.filter(Boolean);
this.cache.del();
return this.post<Result>({ key: 'logout' });
return this.post<Result>({ key: 'logout', data: { tokens } });
}
/**
*