fix: 系统用户信息修改导致Sex/Password字段为空

This commit is contained in:
TsMask committed 2024-10-15 11:43:35 +08:00
1 parent 873dadf014
commit 065895e1d2
7 files changed
+220 -226

No files matched your search

+15 -6
View File
@@ -157,6 +157,7 @@ func (s *SysProfileController) UpdateProfile(c *gin.Context) {
PhoneNumber: body.PhoneNumber,
Email: body.Email,
Sex: body.Sex,
Remark: loginUser.User.Remark,
}
rows := s.sysUserService.UpdateUser(sysUser)
if rows > 0 {
@@ -229,9 +230,13 @@ func (s *SysProfileController) UpdatePwd(c *gin.Context) {
// 修改新密码
sysUser := model.SysUser{
UserID: userId,
UpdateBy: userName,
Password: body.NewPassword,
UserID: userId,
UpdateBy: userName,
Password: body.NewPassword,
Sex: user.Sex,
PhoneNumber: user.PhoneNumber,
Email: user.Email,
Remark: user.Remark,
}
rows := s.sysUserService.UpdateUser(sysUser)
if rows > 0 {
@@ -268,9 +273,13 @@ func (s *SysProfileController) Avatar(c *gin.Context) {
// 更新头像地址
sysUser := model.SysUser{
UserID: loginUser.UserID,
UpdateBy: loginUser.User.UserName,
Avatar: filePath,
UserID: loginUser.UserID,
UpdateBy: loginUser.User.UserName,
Avatar: filePath,
Sex: loginUser.User.Sex,
PhoneNumber: loginUser.User.PhoneNumber,
Email: loginUser.User.Email,
Remark: loginUser.User.Remark,
}
rows := s.sysUserService.UpdateUser(sysUser)
if rows > 0 {