feat: request && login && router【e6939e22】(验证码)

This commit is contained in:
YunaiV
2025-03-24 20:11:44 +08:00
parent c2914d2002
commit 1112409a3b
3 changed files with 62 additions and 47 deletions

View File

@@ -30,16 +30,12 @@ export namespace AuthApi {
}
/**
* 登录
*/
/** 登录 */
export async function loginApi(data: AuthApi.LoginParams) {
return requestClient.post<AuthApi.LoginResult>('/system/auth/login', data);
}
/**
* 刷新 accessToken
*/
/** 刷新 accessToken */
export async function refreshTokenApi() {
// TODO @芋艿refreshToken 传递
return baseRequestClient.post<AuthApi.RefreshTokenResult>('/system/auth/refresh', {
@@ -47,55 +43,38 @@ export async function refreshTokenApi() {
});
}
/**
* 退出登录
*/
/** 退出登录 */
export async function logoutApi() {
return baseRequestClient.post('/system/auth/logout', {
withCredentials: true,
});
}
// /**
// * 获取用户权限码
// */
// export async function getAccessCodesApi() {
// return requestClient.get<string[]>('/auth/codes');
// }
/**
* 获取权限信息
*/
/** 获取权限信息 */
export function getAuthPermissionInfoApi() {
return requestClient.get<AuthPermissionInfo>(
'/system/auth/get-permission-info',
);
}
/**
* 获取租户列表
*/
/** 获取租户列表 */
export function getTenantSimpleList() {
return requestClient.get<AuthApi.TenantResult[]>(
`/system/tenant/simple-list`,
);
}
/**
* 使用租户域名,获得租户信息
*/
/** 使用租户域名,获得租户信息 */
export function getTenantByWebsite(website: string) {
// TODO @芋艿:改成 params 传递?
return requestClient.get<AuthApi.TenantResult>(`/system/tenant/get-by-website?website=${website}`);
}
// TODO 芋艿:后续怎么放好。
// // 获取验证图片 以及token
// export async function getCaptcha(data: any) {
// return baseRequestClient.post('/system/captcha/get', data);
// }
//
// // 滑动或者点选验证
// export async function checkCaptcha(data: any) {
// return baseRequestClient.post('/system/captcha/check', data);
// }
/** 获取验证码 */
export async function getCaptcha(data: any) {
return baseRequestClient.post('/system/captcha/get', data);
}
/** 校验验证码 */
export async function checkCaptcha(data: any) {
return baseRequestClient.post('/system/captcha/check', data);
}