From 45c304c3d699117d45f2bf4a67bd5a9b36d7cd96 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 22 Jul 2022 22:14:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=B1=E9=9B=84=E5=8F=98=E6=9B=B4=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/user/api_create.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/user/api_create.go b/modules/user/api_create.go index 4420c3b65..94e05926b 100644 --- a/modules/user/api_create.go +++ b/modules/user/api_create.go @@ -3,6 +3,7 @@ package user import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" "google.golang.org/protobuf/proto" ) @@ -66,15 +67,18 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (c code = pb.ErrorCode_DBError return } - + var ( + res []*cfg.Game_atn + ) //初始化英雄卡 if val, err := this.module.configure.GetGlobalInitConf(); err == nil { for _, v := range val.GetDataList() { + res = append(res, v.Var...) - code = this.module.DispenseRes(session, v.Var, true) - if code != pb.ErrorCode_Success { - this.module.Errorf("资源发放失败,%v", code) - } + } + code = this.module.DispenseRes(session, res, true) + if code != pb.ErrorCode_Success { + this.module.Errorf("资源发放失败,%v", code) } //defaultHero := utils.TrInt32(val) // err = this.hero.CreateHeroes(session.GetUserId(), defaultHero...)