feat:添加管理员登录
This commit is contained in:
18
src/api/admin-ping.ts
Normal file
18
src/api/admin-ping.ts
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user