File size: 683 Bytes
dc649b1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import { baseRequestClient, requestClient } from '#/api/request';
export namespace AuthApi {
export interface LoginParams {
password?: string;
username?: string;
}
export interface LoginResult {
accessToken: string;
}
}
export async function loginApi(data: AuthApi.LoginParams) {
return requestClient.post<AuthApi.LoginResult>('/admin/auth/login', data);
}
export async function logoutApi() {
return baseRequestClient.post('/admin/auth/logout');
}
export async function getAccessCodesApi() {
return requestClient.get<string[]>('/admin/auth/codes');
}
export async function refreshTokenApi() {
return baseRequestClient.post('/admin/auth/refresh');
}
|