fix: 修复登录无权限问题

This commit is contained in:
陈淳
2023-11-09 08:49:59 +08:00
parent 1f1f7f167f
commit 9158a38496
3 changed files with 7 additions and 2 deletions

View File

@@ -127,6 +127,11 @@ namespace Yi.Furion.Application.Rbac.Services.Impl
{
throw new UserFriendlyException(UserConst.No_Role);
}
if (userInfo.PermissionCodes.Count == 0)
{
throw new UserFriendlyException(UserConst.No_Permission);
}
//这里抛出一个登录的事件
var loginLogEntity = _httpContextAccessor.HttpContext.GetLoginLogInfo();
await _eventPublisher.PublishAsync(new LoginEventSource(new LoginEventArgs
@@ -345,7 +350,7 @@ namespace Yi.Furion.Application.Rbac.Services.Impl
/// <param name="input"></param>
/// <returns></returns>
[HttpPut]
public async Task<bool> RestPasswordAsync(long userId, RestPasswordDto input)
public async Task<bool> RestPasswordAsync(long userId,[FromBody] RestPasswordDto input)
{
if (string.IsNullOrEmpty(input.Password))
{

View File

@@ -8,6 +8,6 @@ namespace Yi.Furion.Core.Rbac.Dtos.Account
{
public class RestPasswordDto
{
public string Password = string.Empty;
public string Password { get; set; } = string.Empty;
}
}