fix 扫描问题
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Dlhis.Basic.Common.ApiLog.Controller;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// API日志控制器
|
/// API日志控制器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Authorize]
|
[Authorize(Roles = "admin")]
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class ApiLogController : ControllerBase
|
public class ApiLogController : ControllerBase
|
||||||
|
|||||||
@@ -67,7 +67,9 @@ public class GainfoFaceService : IGainfoFaceService
|
|||||||
|
|
||||||
public async Task<GainfoFacePageSummaryResponse> GetPageAsync(GainfoFacePageRequest request)
|
public async Task<GainfoFacePageSummaryResponse> GetPageAsync(GainfoFacePageRequest request)
|
||||||
{
|
{
|
||||||
|
var tenantIds = _currentUser.GetUserClaim("tenants").Split(",").ToList();
|
||||||
var factories = request.Factories;
|
var factories = request.Factories;
|
||||||
|
factories = factories.Where(x => tenantIds.Contains(x)).ToList();
|
||||||
|
|
||||||
var userCodes = await _dbContext.Queryable<GainfoEntity>().Where(x => factories.Contains(x.Factory)).Select(x => x.Code).ToListAsync();
|
var userCodes = await _dbContext.Queryable<GainfoEntity>().Where(x => factories.Contains(x.Factory)).Select(x => x.Code).ToListAsync();
|
||||||
var existsFaceCodes = await _faceDbContext.Queryable<GainfoFaceEntity>().Where(x => userCodes.Contains(x.UserCode)).Select(x => x.UserCode).ToListAsync();
|
var existsFaceCodes = await _faceDbContext.Queryable<GainfoFaceEntity>().Where(x => userCodes.Contains(x.UserCode)).Select(x => x.UserCode).ToListAsync();
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ public class IdentityUserSyncService : IIdentityUserSyncService
|
|||||||
NormalizedUserName = userName.ToUpper(),
|
NormalizedUserName = userName.ToUpper(),
|
||||||
ConcurrencyStamp = Guid.NewGuid().ToString(),
|
ConcurrencyStamp = Guid.NewGuid().ToString(),
|
||||||
SecurityStamp = Guid.NewGuid().ToString(),
|
SecurityStamp = Guid.NewGuid().ToString(),
|
||||||
|
LockoutEnabled = true
|
||||||
};
|
};
|
||||||
password = hasher.HashPassword(user, password);
|
password = hasher.HashPassword(user, password);
|
||||||
user.PasswordHash = password;
|
user.PasswordHash = password;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ namespace Dlhis.Sys.Identity.Controllers;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户
|
/// 用户
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Authorize]
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class UsersController : ControllerBase
|
public class UsersController : ControllerBase
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ public class UserService : IUserService
|
|||||||
NormalizedUserName = request.Username.ToUpper(),
|
NormalizedUserName = request.Username.ToUpper(),
|
||||||
ConcurrencyStamp = Guid.NewGuid().ToString(),
|
ConcurrencyStamp = Guid.NewGuid().ToString(),
|
||||||
SecurityStamp = Guid.NewGuid().ToString(),
|
SecurityStamp = Guid.NewGuid().ToString(),
|
||||||
|
LockoutEnabled = true
|
||||||
};
|
};
|
||||||
request.Password = hasher.HashPassword(user, request.Password);
|
request.Password = hasher.HashPassword(user, request.Password);
|
||||||
user.PasswordHash = request.Password;
|
user.PasswordHash = request.Password;
|
||||||
|
|||||||
Reference in New Issue
Block a user