集成CSRedis分布式存储,调整创建者和更新者字段,登录RSA使用配置文件配置私钥
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Lazy.Captcha.Core;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using NETCore.Encrypt;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Model.System;
|
||||
using ZR.Model.System.Dto;
|
||||
@@ -47,7 +48,9 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
roleService = sysRoleService;
|
||||
this.optionSettings = optionSettings.Value;
|
||||
}
|
||||
|
||||
|
||||
// RSA私钥
|
||||
private static readonly string PrivatePem = AppSettings.GetConfig("RSA:PrivatePem");
|
||||
|
||||
/// <summary>
|
||||
/// 登录
|
||||
@@ -69,6 +72,10 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
|
||||
sysLoginService.CheckLockUser(loginBody.Username);
|
||||
string location = HttpContextExtension.GetIpInfo(loginBody.LoginIP);
|
||||
|
||||
// RSA解密
|
||||
loginBody.Password = EncryptProvider.RSADecryptWithPem(PrivatePem, loginBody.Password);
|
||||
|
||||
var user = sysLoginService.Login(loginBody, new SysLogininfor() { LoginLocation = location });
|
||||
|
||||
List<SysRole> roles = roleService.SelectUserRoleListByUserId(user.UserId);
|
||||
|
||||
Reference in New Issue
Block a user