🐛 代理充值

This commit is contained in:
sugarBecomer
2025-11-07 19:46:25 +08:00
parent d3869f68f8
commit face5ca364
+2 -1
View File
@@ -76,10 +76,11 @@ func (s *AgentServiceV1) Ban(ctx context.Context, req *v1.AgentBanReq) *utils.Re
}
func (s *AgentServiceV1) Recharge(ctx context.Context, req *v1.AgentRechargeReq) *utils.Response[any] {
user := db.Global.SysUser.Query().Where(sysuser.IDEQ(req.ID)).WithAgent().OnlyX(ctx)
if !utils.IsAdminFromCtx(ctx) {
currentUser := utils.GetUserInfoFromCtx(ctx)
// 参数校验
user := db.Global.SysUser.Query().Where(sysuser.IDEQ(req.ID)).WithAgent().OnlyX(ctx)
if user.Edges.Agent == nil {
return utils.FailParam("用户不是代理")
}