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