Files
lotteryFront/src/api/play.ts
kang ea75120269 feat: 增强大厅与结果展示功能
- 在 .env.example 中新增可选配置项 NEXT_PUBLIC_LOTTERY_PLAY_CURRENCY
- 在 API 模块中导出 getPlayEffective 函数
- 在 HallScreen 组件中引入 HallPlayCatalogPanel 以展示玩法目录
- 在多个屏幕组件中使用 queueMicrotask 优化数据加载逻辑
- 在 lottery-locale.ts 中新增 getLotteryRequestLocale 函数以支持语言选择
- 在类型定义中新增与玩法相关的类型导出
2026-05-11 10:09:06 +08:00

27 lines
803 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { lotteryRequest } from "@/lib/lottery-http";
import { API_V1_PREFIX } from "@/api/paths";
import type { PlayEffectivePayload } from "@/types/api/play-effective";
export type GetPlayEffectiveParams = {
/** 不传则后端取首个可下注币种(通常为 NPR */
currency?: string;
};
/**
* `GET /api/v1/play/effective`(公开;无需登录)。
* 对齐阶段 4生效玩法目录 + 赔率快照 + 封顶样本。
*/
export function getPlayEffective(
params?: GetPlayEffectiveParams,
): Promise<PlayEffectivePayload> {
return lotteryRequest.get<PlayEffectivePayload>(
`${API_V1_PREFIX}/play/effective`,
{
params:
params?.currency !== undefined && params.currency !== ""
? { currency: params.currency }
: undefined,
},
);
}