feat:添加管理员登录

This commit is contained in:
2026-05-09 11:16:00 +08:00
parent 56951c0383
commit cda7824eb2
19 changed files with 484 additions and 44 deletions

18
src/api/admin-ping.ts Normal file
View File

@@ -0,0 +1,18 @@
import { adminRequest, hasLotteryAdminApiBaseUrl } from "@/lib/admin-http";
import type { AdminPingResponse } from "@/types/api/admin-ping";
import { API_V1_PREFIX } from "@/api/paths";
/** `GET /api/v1/admin/ping`(需 Bearer Token */
export async function getAdminPing(): Promise<AdminPingResponse | null> {
if (!hasLotteryAdminApiBaseUrl()) {
return null;
}
try {
return await adminRequest.get<AdminPingResponse>(
`${API_V1_PREFIX}/admin/ping`,
);
} catch {
return null;
}
}