Merge branch 'abp-dev' of https://gitee.com/ccnetcore/Yi into abp-dev
This commit is contained in:
@@ -75,7 +75,7 @@ namespace Yi.Framework.Core.Extensions
|
|||||||
|
|
||||||
result = result.Replace("::ffff:", "127.0.0.1");
|
result = result.Replace("::ffff:", "127.0.0.1");
|
||||||
|
|
||||||
//Ip规则效验
|
//Ip规则校验
|
||||||
var regResult = Regex.IsMatch(result, @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$");
|
var regResult = Regex.IsMatch(result, @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$");
|
||||||
|
|
||||||
result = regResult ? result : "127.0.0.1";
|
result = regResult ? result : "127.0.0.1";
|
||||||
|
|||||||
@@ -90,6 +90,11 @@ namespace Yi.Framework.Bbs.Application.Services
|
|||||||
return WeekTimeHandler(lastSeven.ToArray());
|
return WeekTimeHandler(lastSeven.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Todo: 可放入领域层
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="data"></param>
|
||||||
|
/// <returns></returns>
|
||||||
private AccessLogDto[] WeekTimeHandler(AccessLogEntity[] data)
|
private AccessLogDto[] WeekTimeHandler(AccessLogEntity[] data)
|
||||||
{
|
{
|
||||||
data = data.Where(x => x.CreationTime >= GetWeekFirst()).OrderByDescending(x => x.CreationTime).DistinctBy(x => x.CreationTime.DayOfWeek).ToArray();
|
data = data.Where(x => x.CreationTime >= GetWeekFirst()).OrderByDescending(x => x.CreationTime).DistinctBy(x => x.CreationTime.DayOfWeek).ToArray();
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 点赞,返回true为点赞+1,返回false为点赞-1
|
/// 点赞,返回true为点赞+1,返回false为点赞-1
|
||||||
|
/// Todo: 可放入领域层
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 效验创建权限,userId为主题创建者
|
/// 校验创建权限,userId为主题创建者
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="disucssId"></param>
|
/// <param name="disucssId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
|||||||
private IDiscussService _discussService { get; set; }
|
private IDiscussService _discussService { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取改主题下的评论,结构为二维列表,该查询无分页
|
/// 获取改主题下的评论,结构为二维列表,该查询无分页
|
||||||
|
/// Todo: 可放入领域层
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="discussId"></param>
|
/// <param name="discussId"></param>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ using Yi.Framework.SqlSugarCore.Abstractions;
|
|||||||
namespace Yi.Framework.Bbs.Application.Services.Forum
|
namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Discuss应用服务实现,用于参数效验、领域服务业务组合、日志记录、事务处理、账户信息
|
/// Discuss应用服务实现,用于参数校验、领域服务业务组合、日志记录、事务处理、账户信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DiscussService : YiCrudAppService<DiscussEntity, DiscussGetOutputDto, DiscussGetListOutputDto, Guid, DiscussGetListInputVo, DiscussCreateInputVo, DiscussUpdateInputVo>,
|
public class DiscussService : YiCrudAppService<DiscussEntity, DiscussGetOutputDto, DiscussGetListOutputDto, Guid, DiscussGetListInputVo, DiscussCreateInputVo, DiscussUpdateInputVo>,
|
||||||
IDiscussService
|
IDiscussService
|
||||||
@@ -221,7 +221,7 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 效验主题查询权限
|
/// 校验主题查询权限
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="discussId"></param>
|
/// <param name="discussId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ namespace Yi.Framework.Bbs.Application.Services.Integral
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取本月签到记录
|
/// 获取本月签到记录
|
||||||
|
/// Todo: 可放入领域层
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ namespace Yi.Framework.Bbs.Application.Services.Integral
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 大转盘
|
/// 大转盘
|
||||||
|
/// Todo: 可放入领域层
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
|||||||
|
|
||||||
var sigInLast = await _signInRepository._DbQueryable.Where(x => x.CreatorId == userId).OrderByDescending(x => x.CreationTime).FirstAsync();
|
var sigInLast = await _signInRepository._DbQueryable.Where(x => x.CreatorId == userId).OrderByDescending(x => x.CreationTime).FirstAsync();
|
||||||
|
|
||||||
//verify 效验是否允许签到了
|
//verify 校验是否允许签到了
|
||||||
if (sigInLast is not null)
|
if (sigInLast is not null)
|
||||||
{
|
{
|
||||||
VerifySignInTime(sigInLast.CreationTime);
|
VerifySignInTime(sigInLast.CreationTime);
|
||||||
@@ -65,7 +65,7 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 效验签到时间
|
/// 校验签到时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dataTime"></param>
|
/// <param name="dataTime"></param>
|
||||||
/// <exception cref="UserFriendlyException"></exception>
|
/// <exception cref="UserFriendlyException"></exception>
|
||||||
|
|||||||
@@ -64,14 +64,14 @@ namespace Yi.Framework.Rbac.Application.Services
|
|||||||
private IAccountManager _accountManager;
|
private IAccountManager _accountManager;
|
||||||
private ISqlSugarRepository<MenuEntity> _menuRepository;
|
private ISqlSugarRepository<MenuEntity> _menuRepository;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 效验图片登录验证码,无需和账号绑定
|
/// 校验图片登录验证码,无需和账号绑定
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
private void ValidationImageCaptcha(LoginInputVo input)
|
private void ValidationImageCaptcha(LoginInputVo input)
|
||||||
{
|
{
|
||||||
if (_rbacOptions.EnableCaptcha)
|
if (_rbacOptions.EnableCaptcha)
|
||||||
{
|
{
|
||||||
//登录不想要验证码 ,可不效验
|
//登录不想要验证码 ,可不校验
|
||||||
if (!_captcha.Validate(input.Uuid, input.Code))
|
if (!_captcha.Validate(input.Uuid, input.Code))
|
||||||
{
|
{
|
||||||
throw new UserFriendlyException("验证码错误");
|
throw new UserFriendlyException("验证码错误");
|
||||||
@@ -94,11 +94,11 @@ namespace Yi.Framework.Rbac.Application.Services
|
|||||||
throw new UserFriendlyException("请输入合理数据!");
|
throw new UserFriendlyException("请输入合理数据!");
|
||||||
}
|
}
|
||||||
|
|
||||||
//效验验证码
|
//校验验证码
|
||||||
ValidationImageCaptcha(input);
|
ValidationImageCaptcha(input);
|
||||||
|
|
||||||
UserEntity user = new();
|
UserEntity user = new();
|
||||||
//效验
|
//校验
|
||||||
await _accountManager.LoginValidationAsync(input.UserName, input.Password, x => user = x);
|
await _accountManager.LoginValidationAsync(input.UserName, input.Password, x => user = x);
|
||||||
|
|
||||||
//获取token
|
//获取token
|
||||||
@@ -186,7 +186,7 @@ namespace Yi.Framework.Rbac.Application.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 效验电话验证码,需要与电话号码绑定
|
/// 校验电话验证码,需要与电话号码绑定
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private async Task ValidationPhoneCaptchaAsync(RegisterDto input)
|
private async Task ValidationPhoneCaptchaAsync(RegisterDto input)
|
||||||
{
|
{
|
||||||
@@ -240,10 +240,10 @@ namespace Yi.Framework.Rbac.Application.Services
|
|||||||
throw new UserFriendlyException("密码需大于等于6位!");
|
throw new UserFriendlyException("密码需大于等于6位!");
|
||||||
}
|
}
|
||||||
|
|
||||||
//效验用户名
|
//校验用户名
|
||||||
ValidateUserName(input);
|
ValidateUserName(input);
|
||||||
|
|
||||||
//效验验证码,根据电话号码获取 value,比对验证码已经uuid
|
//校验验证码,根据电话号码获取 value,比对验证码已经uuid
|
||||||
await ValidationPhoneCaptchaAsync(input);
|
await ValidationPhoneCaptchaAsync(input);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ namespace Yi.Framework.Rbac.Application.Services
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 上传文件
|
/// 上传文件
|
||||||
|
/// Todo: 可放入领域层
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<FileGetListOutputDto>> Post([FromForm] IFormFileCollection file)
|
public async Task<List<FileGetListOutputDto>> Post([FromForm] IFormFileCollection file)
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ namespace Yi.Framework.Rbac.Domain.Managers
|
|||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 登录效验
|
/// 登录校验
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="userName"></param>
|
/// <param name="userName"></param>
|
||||||
/// <param name="password"></param>
|
/// <param name="password"></param>
|
||||||
@@ -176,7 +176,7 @@ namespace Yi.Framework.Rbac.Domain.Managers
|
|||||||
{
|
{
|
||||||
userAction.Invoke(user);
|
userAction.Invoke(user);
|
||||||
}
|
}
|
||||||
//这里为了兼容解决数据库开启了大小写不敏感问题,还要将用户名进行二次效验
|
//这里为了兼容解决数据库开启了大小写不敏感问题,还要将用户名进行二次校验
|
||||||
if (user != null&&user.UserName==userName)
|
if (user != null&&user.UserName==userName)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -16,6 +16,16 @@ Log.Logger = new LoggerConfiguration()
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Log.Information("""
|
||||||
|
|
||||||
|
__ ___ ______ _
|
||||||
|
\ \ / (_) | ____| | |
|
||||||
|
\ \_/ / _ | |__ _ __ __ _ _ __ ___ _____ _____ _ __| | __
|
||||||
|
\ / | | | __| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ /
|
||||||
|
| | | | | | | | | (_| | | | | | | __/\ V V / (_) | | | <
|
||||||
|
|_| |_| |_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\
|
||||||
|
|
||||||
|
""");
|
||||||
Log.Information("Yi框架-Abp.vNext,启动!");
|
Log.Information("Yi框架-Abp.vNext,启动!");
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|||||||
Reference in New Issue
Block a user