feat(admin,api,player): 代理层级管理、额度上下分与玩家钱包详情

新增代理管理器与二级代理体系,完善信用额度/上下分上下文与冻结策略;代理端玩家与子代理管理增强;玩家端新增钱包详情页与交易筛选优化。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-08 15:34:12 +08:00
parent b2216abd0c
commit 414998ce36
54 changed files with 6641 additions and 481 deletions

View File

@@ -56,6 +56,23 @@ export class AuthService {
throw new ForbiddenException('Account disabled');
}
if (portal === 'agent' && user.status === 'SUSPENDED') {
throw new ForbiddenException('Agent account suspended');
}
if (portal === 'player' && user.parentId) {
const agentSettings = await this.systemConfig.getAgentSuspendSettings();
if (agentSettings.suspendBlockPlayerLogin) {
const parentAgent = await this.prisma.user.findUnique({
where: { id: user.parentId },
select: { userType: true, status: true },
});
if (parentAgent?.userType === 'AGENT' && parentAgent.status !== 'ACTIVE') {
throw new ForbiddenException('上级代理已停用,暂无法登录');
}
}
}
if (user.auth.lockedUntil && user.auth.lockedUntil > new Date()) {
throw new ForbiddenException('Account locked, try again later');
}
@@ -101,6 +118,7 @@ export class AuthService {
userType: user.userType,
locale: user.locale,
role: user.adminRole?.role?.code,
agentLevel: user.userType === 'AGENT' ? user.agentLevel : null,
},
};
}