mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-13 04:59:27 +08:00
数据权限功能
This commit is contained in:
@@ -64,10 +64,8 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
[HttpPost]
|
||||
public async Task<Result> Login(LoginDto loginDto)
|
||||
{
|
||||
|
||||
//跳过
|
||||
//跳过,需要redis缓存获取uuid与code的关系,进行比较即可
|
||||
//先效验验证码和UUID
|
||||
|
||||
UserEntity user = new();
|
||||
if (await _iUserService.Login(loginDto.UserName, loginDto.Password, o => user = o))
|
||||
{
|
||||
@@ -181,7 +179,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
{
|
||||
var uuid = Guid.NewGuid();
|
||||
var code = _securityCode.GetRandomEnDigitalText(4);
|
||||
//将uuid与code中心化保存起来,登录根据uuid比对即可
|
||||
//将uuid与code,Redis缓存中心化保存起来,登录根据uuid比对即可
|
||||
var imgbyte = _securityCode.GetEnDigitalCodeByte(code);
|
||||
return Result.Success().SetData(new { uuid = uuid, img = imgbyte });
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ using Microsoft.Extensions.Localization;
|
||||
using Yi.Framework.WebCore.AttributeExtend;
|
||||
using Yi.Framework.WebCore.SignalRHub;
|
||||
using Hei.Captcha;
|
||||
using Yi.Framework.WebCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Configuration.AddCommandLine(args);
|
||||
@@ -52,9 +54,10 @@ builder.Host.ConfigureLogging(loggingBuilder =>
|
||||
#endregion
|
||||
builder.Services.AddIocService(builder.Configuration);
|
||||
#region
|
||||
//Sqlsugar上下文注入
|
||||
//Sqlsugar上下文注入,是否开启数据权限功能,开启需要Redis缓存
|
||||
#endregion
|
||||
builder.Services.AddSqlsugarServer();
|
||||
//builder.Services.AddSqlsugarServer(DbFiterExtend.Data);
|
||||
#region
|
||||
//Quartz任务调度配置
|
||||
#endregion
|
||||
@@ -117,8 +120,14 @@ builder.Services.AddLocalizerService();
|
||||
//添加signalR
|
||||
#endregion
|
||||
builder.Services.AddSignalR();
|
||||
|
||||
#region
|
||||
//添加验证码
|
||||
#endregion
|
||||
builder.Services.AddHeiCaptcha();
|
||||
#region
|
||||
//添加Http上下文
|
||||
#endregion
|
||||
builder.Services.AddHttpContextAccessor();
|
||||
//-----------------------------------------------------------------------------------------------------------
|
||||
var app = builder.Build();
|
||||
#region
|
||||
|
||||
Reference in New Issue
Block a user