优化菜单管理请求参数

This commit is contained in:
不做码农
2022-05-24 18:44:11 +08:00
parent bd0361552d
commit 4a440f3b1c
6 changed files with 39 additions and 21 deletions

View File

@@ -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,12 @@ 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.ToLower())
if (!user.Password.Equals(oldMd5, StringComparison.OrdinalIgnoreCase))
{
return ToResponse(ApiResult.Error("修改密码失败,旧密码错误"));
}
if (user.Password == newMd5.ToLower())
if (user.Password.Equals(newMd5, StringComparison.OrdinalIgnoreCase))
{
return ToResponse(ApiResult.Error("新密码不能和旧密码相同"));
}