Skip to content

Commit 0b96ba3

Browse files
author
piexlmax
committed
禁止通过setUserInfo接口修改用户密码
1 parent e951225 commit 0b96ba3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server/api/v1/system/sys_user.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ func (b *BaseApi) SetUserInfo(c *gin.Context) {
275275
var user system.SysUser
276276
_ = c.ShouldBindJSON(&user)
277277
user.Username = ""
278+
user.Password = ""
278279
if err := utils.Verify(user, utils.IdVerify); err != nil {
279280
response.FailWithMessage(err.Error(), c)
280281
return
@@ -299,6 +300,7 @@ func (b *BaseApi) SetSelfInfo(c *gin.Context) {
299300
var user system.SysUser
300301
_ = c.ShouldBindJSON(&user)
301302
user.Username = ""
303+
user.Password = ""
302304
user.ID = utils.GetUserID(c)
303305
if err, ReqUser := userService.SetUserInfo(user); err != nil {
304306
global.GVA_LOG.Error("设置失败!", zap.Error(err))

0 commit comments

Comments
 (0)