fix: 设置登录IP和登录时间

This commit is contained in:
TsMask
2023-10-21 17:43:17 +08:00
parent 7aca7b2fc1
commit ec76e34576
5 changed files with 28 additions and 4 deletions

View File

@@ -256,6 +256,8 @@ func (s *SysUserController) Edit(c *gin.Context) {
body.UserName = "" // 忽略修改登录用户名称
body.Password = "" // 忽略修改密码
body.LoginIP = "" // 忽略登录IP
body.LoginDate = 0 // 忽略登录时间
body.UpdateBy = ctx.LoginUserToUserName(c)
rows := s.sysUserService.UpdateUserAndRolePost(body)
if rows > 0 {
@@ -320,12 +322,12 @@ func (s *SysUserController) ResetPwd(c *gin.Context) {
}
userName := ctx.LoginUserToUserName(c)
SysUserController := model.SysUser{
info := model.SysUser{
UserID: body.UserID,
Password: body.Password,
UpdateBy: userName,
}
rows := s.sysUserService.UpdateUser(SysUserController)
rows := s.sysUserService.UpdateUser(info)
if rows > 0 {
c.JSON(200, result.Ok(nil))
return
@@ -360,12 +362,12 @@ func (s *SysUserController) Status(c *gin.Context) {
}
userName := ctx.LoginUserToUserName(c)
SysUserController := model.SysUser{
info := model.SysUser{
UserID: body.UserID,
Status: body.Status,
UpdateBy: userName,
}
rows := s.sysUserService.UpdateUser(SysUserController)
rows := s.sysUserService.UpdateUser(info)
if rows > 0 {
c.JSON(200, result.Ok(nil))
return