diff --git a/logic/service/player/Monster.go b/logic/service/player/Monster.go index 2c4b0f7a8..97f8db10f 100644 --- a/logic/service/player/Monster.go +++ b/logic/service/player/Monster.go @@ -23,7 +23,7 @@ func RandomStringFromSlice(s []string) string { func (p *Player) Next(time.Time) time.Time { if atomic.LoadUint32(&p.Canmon) != 1 { - return time.Now().Add(5 * time.Second) + return time.Now().Add(7 * time.Second) } return time.Now().Add(10 * time.Second) @@ -86,7 +86,7 @@ func (p *Player) genMonster() { if cool.Config.PortBL == 2 { //测试服,百分百异色 p.OgreInfo.Data[i].RandSHiny() } - if xmlres.PetMAP[int(p.OgreInfo.Data[i].Id)].CatchRate != 0 && grand.Meet(1, 100) { + if xmlres.PetMAP[int(p.OgreInfo.Data[i].Id)].CatchRate != 0 && grand.Meet(7, 1000) { p.OgreInfo.Data[i].RandSHiny() } if ok { diff --git a/modules/base/controller/admin/base_comm.go b/modules/base/controller/admin/base_comm.go index f1bf6128b..a6dba4e2e 100644 --- a/modules/base/controller/admin/base_comm.go +++ b/modules/base/controller/admin/base_comm.go @@ -102,17 +102,17 @@ type PersonUpdateReq struct { Authorization string `json:"Authorization" in:"header"` } -// PersonUpdate 方法 -func (c *BaseCommController) PersonUpdate(ctx g.Ctx, req *PersonUpdateReq) (res *cool.BaseRes, err error) { - var ( - baseSysUserService = service.NewBaseSysUserService() - ) +// // PersonUpdate 方法 +// func (c *BaseCommController) PersonUpdate(ctx g.Ctx, req *PersonUpdateReq) (res *cool.BaseRes, err error) { +// var ( +// baseSysUserService = service.NewBaseSysUserService() +// ) - _, err = baseSysUserService.ServiceUpdate(ctx, &cool.UpdateReq{}) - if err != nil { - return - } +// _, err = baseSysUserService.ServiceUpdate(ctx, &cool.UpdateReq{}) +// if err != nil { +// return +// } - res = cool.Ok(nil) - return -} +// res = cool.Ok(nil) +// return +// } diff --git a/modules/base/service/base_sys_user.go b/modules/base/service/base_sys_user.go index 855477f65..89e560cde 100644 --- a/modules/base/service/base_sys_user.go +++ b/modules/base/service/base_sys_user.go @@ -82,7 +82,7 @@ func (s *BaseSysUserService) ModifyBefore(ctx context.Context, method string, pa // 禁止删除超级管理员 userIds := garray.NewIntArrayFrom(gconv.Ints(param["ids"])) currentId, found := userIds.Get(0) - superAdminId := 1 + superAdminId := 10001 if userIds.Len() == 1 && found && currentId == superAdminId { err = gerror.New("超级管理员不能删除") @@ -90,7 +90,7 @@ func (s *BaseSysUserService) ModifyBefore(ctx context.Context, method string, pa } // 删除超级管理员 - userIds.RemoveValue(1) + userIds.RemoveValue(10001) g.RequestFromCtx(ctx).SetParam("ids", userIds.Slice()) } return @@ -113,8 +113,8 @@ func (s *BaseSysUserService) Gen(user UserAttributes) (data interface{}, err err lastInsertId, err := m.Data(user).Data( g.Map{ - "username": user.Username, - "headImg": user.AvatarUrl, + "username": user.Username, + "headImg": user.AvatarUrl, "departmentId": 1, }, ).InsertAndGetId() @@ -234,7 +234,7 @@ func (s *BaseSysUserService) ServiceUpdate(ctx context.Context, req *cool.Update } // 禁止禁用超级管理员 - if userId == 1 && (!r.Get("status").IsNil() && r.Get("status").Int() == 0) { + if userId == 10001 && (!r.Get("status").IsNil() && r.Get("status").Int() == 0) { err = gerror.New("禁止禁用超级管理员") return } @@ -261,6 +261,7 @@ func (s *BaseSysUserService) ServiceUpdate(ctx context.Context, req *cool.Update } else { delete(rMap, "password") } + delete(rMap, "goldbean") err = g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) (err error) { roleModel := cool.DBM(model.NewBaseSysUserRole()).TX(tx).Where("userId", userId)