feat: request config

pull/48/MERGE
xingyu 2024-11-17 16:36:48 +08:00
parent e33bc6afcf
commit 0096a6b13e
2 changed files with 8 additions and 3 deletions

View File

@ -28,14 +28,14 @@ export namespace AuthApi {
/**
*
*/
export async function loginApi(data: AuthApi.LoginParams) {
export function loginApi(data: AuthApi.LoginParams) {
return requestClient.post<AuthApi.LoginResult>('/system/auth/login', data);
}
/**
* accessToken
*/
export async function refreshTokenApi() {
export function refreshTokenApi() {
return baseRequestClient.post<AuthApi.LoginResult>(
`/system/auth/refresh-token?refreshToken=${getRefreshToken()}`,
{
@ -67,7 +67,7 @@ export function getTenantByWebsite(website: string) {
/**
* 退
*/
export async function logoutApi() {
export function logoutApi() {
return baseRequestClient.post('/system/auth/logout', {
withCredentials: true,
});

View File

@ -133,6 +133,11 @@ function createRequestClient(baseURL: string) {
return client;
}
export type PageParam = {
pageNo?: number;
pageSize?: number;
};
export const requestClient = createRequestClient(apiURL);
export const baseRequestClient = new RequestClient({ baseURL: apiURL });