From a53007d4e847b8f33a52ef5258dd3eda19934226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Thu, 19 May 2022 19:41:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=BF=BD=E7=95=A5=E5=A4=A7=E5=B0=8F=E5=86=99=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Controllers/System/SysProfileController.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/System/SysProfileController.cs b/ZR.Admin.WebApi/Controllers/System/SysProfileController.cs index bfbda91..c531924 100644 --- a/ZR.Admin.WebApi/Controllers/System/SysProfileController.cs +++ b/ZR.Admin.WebApi/Controllers/System/SysProfileController.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; +using System; using System.Threading.Tasks; using ZR.Admin.WebApi.Extensions; using ZR.Admin.WebApi.Filters; @@ -98,11 +99,11 @@ namespace ZR.Admin.WebApi.Controllers.System SysUser user = UserService.SelectUserById(loginUser.UserId); string oldMd5 = NETCore.Encrypt.EncryptProvider.Md5(oldPassword); string newMd5 = NETCore.Encrypt.EncryptProvider.Md5(newPassword); - if (user.Password != oldMd5) + if (!user.Password.Equals(oldMd5, StringComparison.OrdinalIgnoreCase)) { return ToResponse(ApiResult.Error("修改密码失败,旧密码错误")); } - if (user.Password == newMd5) + if (user.Password.Equals(newMd5, StringComparison.OrdinalIgnoreCase)) { return ToResponse(ApiResult.Error("新密码不能和旧密码相同")); }