feat: 新增token过期 跳出提示框 并跳转登录页的逻辑

This commit is contained in:
valarchie
2023-07-07 18:07:13 +08:00
parent de5550e216
commit d0d9bee8b7
6 changed files with 79 additions and 26 deletions

View File

@@ -36,7 +36,7 @@ export type TokenDTO = {
};
export type CurrentLoginUserDTO = {
user: any;
userInfo: any;
roleKey: string;
permissions: Set<string>;
};
@@ -61,3 +61,8 @@ export const getCaptchaCode = () => {
export const loginByPassword = (data: LoginByPasswordDTO) => {
return http.request<ResponseData<TokenDTO>>("post", "/login", { data });
};
/** 获取当前登录用户接口 */
export const getLoginUserInfo = () => {
return http.request<ResponseData<TokenDTO>>("get", "/getLoginUserInfo");
};