feat: enhance player login process with captcha validation and improve wallet display logic
Some checks failed
lotteryfront CI / build (push) Has been cancelled

- Added captcha validation to the player login screen, requiring users to input a captcha code for authentication.
- Implemented a new API call to fetch captcha images, improving security during login.
- Updated wallet display logic to ensure accurate representation of available and total balances based on player funding modes.
- Enhanced documentation in AGENTS.md to clarify changes in credit flow and login requirements.
This commit is contained in:
2026-06-17 15:27:06 +08:00
parent 9711909893
commit 2f1793e0cf
13 changed files with 211 additions and 20 deletions

View File

@@ -1,9 +1,16 @@
import { lotteryRequest } from "@/lib/lottery-http";
export type PlayerAuthCaptchaResponse = {
captcha_key: string;
image_base64: string;
};
export type PlayerAuthLoginPayload = {
site_code?: string;
username: string;
password: string;
captcha_key: string;
captcha_code: string;
};
export type PlayerAuthLoginData = {
@@ -20,6 +27,11 @@ export type PlayerAuthLoginData = {
};
};
/** `GET /api/v1/player/auth/captcha`(公开) */
export function getPlayerAuthCaptcha(): Promise<PlayerAuthCaptchaResponse> {
return lotteryRequest.get<PlayerAuthCaptchaResponse>(`/player/auth/captcha`);
}
/** `POST /api/v1/player/auth/login`(公开) */
export function postPlayerAuthLogin(body: PlayerAuthLoginPayload): Promise<PlayerAuthLoginData> {
return lotteryRequest.post<PlayerAuthLoginData>(`/player/auth/login`, body);