错误校验
This commit is contained in:
parent
05a0e37ab9
commit
69556d7806
@ -27,7 +27,7 @@ func (this *apiComp) GetRandUser(session comm.IUserSession, req *pb.GourmetGetRa
|
||||
szDbUser []*pb.DBUser
|
||||
mapUser map[string]struct{}
|
||||
)
|
||||
mapUser = make(map[string]struct{}, req.People)
|
||||
mapUser = make(map[string]struct{}, 0)
|
||||
code = this.GetRandUserCheck(session, req)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
@ -77,9 +77,10 @@ func (this *apiComp) GetRandUser(session comm.IUserSession, req *pb.GourmetGetRa
|
||||
}
|
||||
}
|
||||
for k := range mapUser {
|
||||
user, _ := this.module.ModuleUser.GetRmoteUser(k)
|
||||
if user, err := this.module.ModuleUser.GetRmoteUser(k); err != nil && user.Uid != "" {
|
||||
szDbUser = append(szDbUser, user) // 转成user对象
|
||||
}
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), GourmetGetRandUserResp, &pb.GourmetGetRandUserResp{User: szDbUser})
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user