修改用户初始

This commit is contained in:
zhaocy 2022-07-21 20:34:10 +08:00
parent 2250c07da4
commit 9989b8376f

View File

@ -4,7 +4,6 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"github.com/spf13/cast"
"google.golang.org/protobuf/proto"
)
@ -54,13 +53,7 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (c
"created": true, //创角标识
}
//设置初始金币
if val := this.module.configure.GetGlobalConf("init_gold"); val != "" {
update["gold"] = cast.ToInt32(val)
}
err := this.module.modelUser.Change(session.GetUserId(), update)
if err != nil {
if err := this.module.modelUser.Change(session.GetUserId(), update); err != nil {
code = pb.ErrorCode_DBError
return
}