- 在 .env.example 中新增可选配置项 NEXT_PUBLIC_LOTTERY_PLAY_CURRENCY - 在 API 模块中导出 getPlayEffective 函数 - 在 HallScreen 组件中引入 HallPlayCatalogPanel 以展示玩法目录 - 在多个屏幕组件中使用 queueMicrotask 优化数据加载逻辑 - 在 lottery-locale.ts 中新增 getLotteryRequestLocale 函数以支持语言选择 - 在类型定义中新增与玩法相关的类型导出
27 lines
803 B
TypeScript
27 lines
803 B
TypeScript
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,
|
||
},
|
||
);
|
||
}
|