2026-04-14 16:27:47 +08:00
|
|
|
import type { ApiResponse } from "../types/api";
|
|
|
|
|
import { http } from "../utils/http";
|
|
|
|
|
|
|
|
|
|
interface LoginInput {
|
|
|
|
|
username: string;
|
|
|
|
|
password: string;
|
|
|
|
|
provinceCode: string;
|
|
|
|
|
areaCode: string;
|
|
|
|
|
tenantId: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function login(input: LoginInput) {
|
2026-04-16 18:12:09 +08:00
|
|
|
return http.post<ApiResponse<{ accessToken: string; refreshToken: string }>>("/auth/tokens", input);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function refreshToken(refreshToken: string) {
|
|
|
|
|
return http.post<ApiResponse<{ accessToken: string; refreshToken: string }>>("/auth/tokens/refresh", {
|
|
|
|
|
refreshToken
|
|
|
|
|
});
|
2026-04-14 16:27:47 +08:00
|
|
|
}
|