update ZR.Admin.WebApi/Controllers/System/SysProfileController.cs.
修改密码过程出错,数据库保存的是小写,这里oldMd5和newMd5是大写字符
This commit is contained in:
parent
53928c1ce1
commit
3640bc70aa
@ -1,4 +1,4 @@
|
|||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
using Infrastructure.Attribute;
|
using Infrastructure.Attribute;
|
||||||
using Infrastructure.Enums;
|
using Infrastructure.Enums;
|
||||||
using Infrastructure.Model;
|
using Infrastructure.Model;
|
||||||
@ -98,15 +98,15 @@ namespace ZR.Admin.WebApi.Controllers.System
|
|||||||
SysUser user = UserService.SelectUserById(loginUser.UserId);
|
SysUser user = UserService.SelectUserById(loginUser.UserId);
|
||||||
string oldMd5 = NETCore.Encrypt.EncryptProvider.Md5(oldPassword);
|
string oldMd5 = NETCore.Encrypt.EncryptProvider.Md5(oldPassword);
|
||||||
string newMd5 = NETCore.Encrypt.EncryptProvider.Md5(newPassword);
|
string newMd5 = NETCore.Encrypt.EncryptProvider.Md5(newPassword);
|
||||||
if (user.Password != oldMd5)
|
if (user.Password != oldMd5.ToLower())
|
||||||
{
|
{
|
||||||
return ToResponse(ApiResult.Error("修改密码失败,旧密码错误"));
|
return ToResponse(ApiResult.Error("修改密码失败,旧密码错误"));
|
||||||
}
|
}
|
||||||
if (user.Password == newMd5)
|
if (user.Password == newMd5.ToLower())
|
||||||
{
|
{
|
||||||
return ToResponse(ApiResult.Error("新密码不能和旧密码相同"));
|
return ToResponse(ApiResult.Error("新密码不能和旧密码相同"));
|
||||||
}
|
}
|
||||||
if (UserService.ResetPwd(loginUser.UserId, newMd5) > 0)
|
if (UserService.ResetPwd(loginUser.UserId, newMd5.ToLower()) > 0)
|
||||||
{
|
{
|
||||||
//TODO 更新缓存
|
//TODO 更新缓存
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user