提交 64ca2a48 编写于 作者: Mr.奇淼('s avatar Mr.奇淼(

禁止通过setUserInfo接口修改用户角色防止越权

上级 0b96ba30
......@@ -276,6 +276,7 @@ func (b *BaseApi) SetUserInfo(c *gin.Context) {
_ = c.ShouldBindJSON(&user)
user.Username = ""
user.Password = ""
user.AuthorityId = ""
if err := utils.Verify(user, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
......@@ -301,6 +302,7 @@ func (b *BaseApi) SetSelfInfo(c *gin.Context) {
_ = c.ShouldBindJSON(&user)
user.Username = ""
user.Password = ""
user.AuthorityId = ""
user.ID = utils.GetUserID(c)
if err, ReqUser := userService.SetUserInfo(user); err != nil {
global.GVA_LOG.Error("设置失败!", zap.Error(err))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册