更新多个 API 文件,将 API_V1_PREFIX 替换为直接使用 /admin 路径。 简化 API 路径定义逻辑,提升代码可读性与维护性。 统一后台管理接口的路由配置,确保各管理端 API 端点保持一致性。
19 lines
497 B
TypeScript
19 lines
497 B
TypeScript
import { hasLotteryAdminApiBaseUrl, publicAdminRequest } from "@/lib/admin-http";
|
||
import type { DrawCurrentSnapshot } from "@/types/api/public-draw";
|
||
|
||
|
||
/** 大厅当前期(无需 Bearer) */
|
||
export async function getDrawCurrent(): Promise<DrawCurrentSnapshot | null> {
|
||
if (!hasLotteryAdminApiBaseUrl()) {
|
||
return null;
|
||
}
|
||
try {
|
||
return await publicAdminRequest<DrawCurrentSnapshot | null>({
|
||
url: `/draw/current`,
|
||
method: "GET",
|
||
});
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|