Commit 70401943 by 王泽龙

修改顺序

parent b3470705
......@@ -375,8 +375,7 @@ public UserResponse UpdateSelf(UserRequest request)
user.Mail = string.IsNullOrEmpty(request.Mail) ? user.Mail : request.Mail;
//Md5小写加密
request.Password = MD5Helper.MD5EncryptSmall32(request.Password + "Suvalue");
user.Password = string.IsNullOrEmpty(request.Password) ? user.Password : request.Password;
user.Password = string.IsNullOrEmpty(request.Password) ? user.Password : MD5Helper.MD5EncryptSmall32(request.Password + "Suvalue");
if (!_userRepository.Update(user))
throw new PerformanceException("保存失败");
......@@ -397,10 +396,8 @@ public UserResponse UpdatePwd(PasswordRequest request, int userId)
if (request.OldPwd != user.Password)
throw new PerformanceException("原密码错误");
user.Password = string.IsNullOrEmpty(request.NewPwd) ? user.Password : request.NewPwd;
//MD5小写加密
user.Password = MD5Helper.MD5EncryptSmall32(user.Password + "Suvalue");
//Md5小写加密
user.Password = string.IsNullOrEmpty(request.NewPwd) ? user.Password : MD5Helper.MD5EncryptSmall32(request.NewPwd + "Suvalue") ;
if (!_userRepository.Update(user))
throw new PerformanceException("保存失败");
return _mapper.Map<UserResponse>(user);
......@@ -503,9 +500,8 @@ public UserResponse ResetPwd(int userId, int loginUserId)
//if (user.CreateUser != loginUserId)
// throw new PerformanceException($"当前用户无权限重置用户密码");
user.Password = "123456";
//MD5小写加密
user.Password = MD5Helper.MD5EncryptSmall32(user.Password + "Suvalue");
user.Password = MD5Helper.MD5EncryptSmall32("123456" + "Suvalue");
if (!_userRepository.Update(user))
throw new PerformanceException("重置失败");
return _mapper.Map<UserResponse>(user);
......@@ -601,8 +597,7 @@ public UserResponse UpdateUser(UserRequest request, int userId)
user.Mail = request.Mail;
user.States = request.States;
//Md5小写加密
request.Password = MD5Helper.MD5EncryptSmall32(request.Password + "Suvalue");
user.Password = string.IsNullOrEmpty(request.Password) ? user.Password : request.Password;
user.Password = string.IsNullOrEmpty(request.Password) ? user.Password : MD5Helper.MD5EncryptSmall32(request.Password + "Suvalue");
user.Department = UnitTypeUtil.Maps.ContainsKey(request.RoleArr[0]) ? request.Department : "";
if (UnitTypeUtil.Maps.ContainsKey(request.RoleArr[0]))
{
......@@ -654,8 +649,7 @@ public UserResponse UpdateUser(UserRequest request, int userId)
diffUser.Mail = request.Mail;
diffUser.States = request.States;
//Md5小写加密
diffUser.Password = MD5Helper.MD5EncryptSmall32(request.Password + "Suvalue");
diffUser.Password = string.IsNullOrEmpty(request.Password) ? user.Password : request.Password;
diffUser.Password = string.IsNullOrEmpty(request.Password) ? user.Password : MD5Helper.MD5EncryptSmall32(request.Password + "Suvalue");
diffUser.Department = UnitTypeUtil.Maps.ContainsKey(request.RoleArr[i]) ? request.Department : "";
if (UnitTypeUtil.Maps.ContainsKey(request.RoleArr[i]))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment