diff --git a/route/group_power_r/group_power.go b/route/group_power_r/group_power.go index c780313ce5d7998d483bdff8466465c82f77810b..73dadb8c1ca3f2f98ed5fddebf57dafc22adb78c 100644 --- a/route/group_power_r/group_power.go +++ b/route/group_power_r/group_power.go @@ -1340,6 +1340,9 @@ func GroupPowerSetAdmin(c *gin.Context) (*mycontext.MyContext, error) { if optGroupPUser == nil { return myContext, bizerr.GroupPowerUserHaveNoJoin } + if optUser.ID == userId { // 不能操作自己 + return myContext, bizerr.GroupPowerHaveNoPower + } // 目标身份 var targetRole groupPower_e.GroupPowerUserRole if optType == 1 { @@ -1352,7 +1355,7 @@ func GroupPowerSetAdmin(c *gin.Context) (*mycontext.MyContext, error) { return myContext, bizerr.GroupPowerHaveAlreadyChange } // 变更 - err = groupPower_m.UpdateFamilyAdmin(model, userId, optGroupPUser.GroupPowerId, targetRole) + err = groupPower_m.UpdateFamilyAdmin(model, optGroupPUser.UserId, optGroupPUser.GroupPowerId, targetRole) if optGroupPUser == nil { return myContext, myerr.WrapErr(err) }