feat: 手动充值、邀请码注册与后台管理增强
新增玩家手动充值全流程(收款方式配置、充值下单/审核、钱包上分), 支持邀请码注册、邀请历史与专属返水率;完善后台代理/玩家管理与响应式操作栏, 并补充前台注册、充值页及多语言错误码。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { FormValidationError } from '../i18n/form-validation';
|
||||
import { decimalRateToPercent } from '../utils/rate-percent';
|
||||
import { percentToDecimalRate } from '../utils/rate-percent';
|
||||
|
||||
/** 玩家用户名:仅英文字母与数字,3–32 位 */
|
||||
export const PLAYER_USERNAME_PATTERN = /^[a-zA-Z0-9]{3,32}$/;
|
||||
@@ -46,6 +48,9 @@ export interface PlayerEditForm {
|
||||
email: string;
|
||||
managedPassword: string | null;
|
||||
newPassword: string;
|
||||
customCashbackRate: number;
|
||||
defaultCashbackRate: number;
|
||||
useCustomCashback: boolean;
|
||||
}
|
||||
|
||||
export interface PlayerRow {
|
||||
@@ -57,6 +62,7 @@ export interface PlayerRow {
|
||||
parentUsername: string | null;
|
||||
/** 归属代理链:一级代理、二级代理(如有) */
|
||||
affiliationAgents?: string[];
|
||||
inviteCode?: string | null;
|
||||
phone: string | null;
|
||||
email: string | null;
|
||||
managedPassword: string | null;
|
||||
@@ -73,6 +79,8 @@ export interface PlayerDetail extends PlayerRow {
|
||||
loginFailCount: number;
|
||||
lockedUntil: string | null;
|
||||
updatedAt: string;
|
||||
customCashbackRate: string | null;
|
||||
defaultCashbackRate: string;
|
||||
}
|
||||
|
||||
/** 玩家归属标签,格式:玩家-平台 | 玩家-一级代理 | 玩家-一级代理-二级代理 */
|
||||
@@ -124,6 +132,9 @@ export function emptyPlayerEditForm(): PlayerEditForm {
|
||||
email: '',
|
||||
managedPassword: null,
|
||||
newPassword: '',
|
||||
customCashbackRate: 0,
|
||||
defaultCashbackRate: 0,
|
||||
useCustomCashback: false,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -146,6 +157,10 @@ export function editFormFromDetail(d: PlayerDetail): PlayerEditForm {
|
||||
email: d.email ?? '',
|
||||
managedPassword: d.managedPassword ?? null,
|
||||
newPassword: '',
|
||||
customCashbackRate:
|
||||
d.customCashbackRate != null ? decimalRateToPercent(d.customCashbackRate) : 0,
|
||||
defaultCashbackRate: decimalRateToPercent(d.defaultCashbackRate),
|
||||
useCustomCashback: d.customCashbackRate != null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -164,7 +179,7 @@ export function buildCreatePlayerPayload(form: PlayerCreateForm) {
|
||||
email: form.email.trim() || undefined,
|
||||
asTier1Agent: true,
|
||||
creditLimit: form.creditLimit,
|
||||
cashbackRate: form.cashbackRate,
|
||||
cashbackRate: percentToDecimalRate(form.cashbackRate),
|
||||
maxSingleDeposit: form.maxSingleDeposit > 0 ? form.maxSingleDeposit : undefined,
|
||||
maxDailyDeposit: form.maxDailyDeposit > 0 ? form.maxDailyDeposit : undefined,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user