feat: enhance wallet functionality and improve error handling

- Updated .env.example to include optional player site code configuration.
- Modified error messages in hall-bet-errors for better clarity.
- Improved the betting grid logic to handle invalid draw IDs and reload draws when necessary.
- Adjusted wallet components to differentiate between credit and main wallet balances, including new translations for credit-related terms.
- Enhanced wallet logs to support credit activity tracking and improved UI for displaying credit information.
This commit is contained in:
2026-06-05 18:01:11 +08:00
parent 3cd87ce014
commit 36adf8699d
21 changed files with 496 additions and 80 deletions

26
src/api/player-auth.ts Normal file
View File

@@ -0,0 +1,26 @@
import { lotteryRequest } from "@/lib/lottery-http";
export type PlayerAuthLoginPayload = {
site_code?: string;
username: string;
password: string;
};
export type PlayerAuthLoginData = {
access_token: string;
expires_in: number;
token_type: string;
player: {
id: number;
site_code: string;
username: string | null;
nickname: string | null;
funding_mode: string;
auth_source: string;
};
};
/** `POST /api/v1/player/auth/login`(公开) */
export function postPlayerAuthLogin(body: PlayerAuthLoginPayload): Promise<PlayerAuthLoginData> {
return lotteryRequest.post<PlayerAuthLoginData>(`/player/auth/login`, body);
}