fix:audit
This commit is contained in:
parent
73d4d112a2
commit
dab31a7c8f
4
db.sql
4
db.sql
@ -11,6 +11,10 @@ SET NAMES utf8mb4;
|
|||||||
SET FOREIGN_KEY_CHECKS = 0;
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `t_warehouse_address`;
|
DROP TABLE IF EXISTS `t_warehouse_address`;
|
||||||
|
DROP TABLE IF EXISTS `t_notice_read`;
|
||||||
|
DROP TABLE IF EXISTS `t_notice`;
|
||||||
|
DROP TABLE IF EXISTS `t_dict`;
|
||||||
|
DROP TABLE IF EXISTS `t_country`;
|
||||||
DROP TABLE IF EXISTS `t_recharge_record`;
|
DROP TABLE IF EXISTS `t_recharge_record`;
|
||||||
DROP TABLE IF EXISTS `t_customer`;
|
DROP TABLE IF EXISTS `t_customer`;
|
||||||
DROP TABLE IF EXISTS `t_label_print_record`;
|
DROP TABLE IF EXISTS `t_label_print_record`;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using Fake.Modularity;
|
using Fake.Modularity;
|
||||||
using Fake.ObjectMapping.AutoMapper;
|
using Fake.ObjectMapping.AutoMapper;
|
||||||
|
using Fake.Security.Claims;
|
||||||
using Oms.Domain;
|
using Oms.Domain;
|
||||||
|
|
||||||
namespace Oms.Application;
|
namespace Oms.Application;
|
||||||
|
|||||||
@ -6,6 +6,7 @@ using Fake.Rbac.Infrastructure;
|
|||||||
using Fake.AspNetCore.Auditing;
|
using Fake.AspNetCore.Auditing;
|
||||||
using Fake.AspNetCore.Mvc;
|
using Fake.AspNetCore.Mvc;
|
||||||
using Fake.FeiShu;
|
using Fake.FeiShu;
|
||||||
|
using Fake.Security.Claims;
|
||||||
using Fake.Serilog;
|
using Fake.Serilog;
|
||||||
using Microsoft.AspNetCore.HttpOverrides;
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
@ -27,6 +28,11 @@ public class SimpleAdminApiModule : FakeModule
|
|||||||
{
|
{
|
||||||
private const string DefaultCorsPolicyName = "default";
|
private const string DefaultCorsPolicyName = "default";
|
||||||
|
|
||||||
|
public override void PreConfigureServices(ServiceConfigurationContext context)
|
||||||
|
{
|
||||||
|
FakeClaimTypes.UserId = "mapId";
|
||||||
|
}
|
||||||
|
|
||||||
public override void ConfigureServices(ServiceConfigurationContext context)
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
||||||
{
|
{
|
||||||
var services = context.Services;
|
var services = context.Services;
|
||||||
|
|||||||
@ -4,6 +4,7 @@ using Fake.DependencyInjection;
|
|||||||
using Fake.Rbac.Application.Jwt;
|
using Fake.Rbac.Application.Jwt;
|
||||||
using Fake.Rbac.Application.Services;
|
using Fake.Rbac.Application.Services;
|
||||||
using Fake.Rbac.Infrastructure;
|
using Fake.Rbac.Infrastructure;
|
||||||
|
using Fake.Security.Claims;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
@ -25,12 +26,10 @@ public class SimpleJwtService(IOptions<JwtOptions> jwtOptions, IUserService user
|
|||||||
.FirstOrDefaultAsync(cancellationToken);
|
.FirstOrDefaultAsync(cancellationToken);
|
||||||
if (mapId.HasValue)
|
if (mapId.HasValue)
|
||||||
{
|
{
|
||||||
claims.RemoveAll(x => x.Type == SimpleOmsClaimTypes.MapId);
|
claims.RemoveAll(x => x.Type == FakeClaimTypes.UserId);
|
||||||
claims.Add(new Claim(SimpleOmsClaimTypes.MapId, mapId.Value.ToString()));
|
claims.Add(new Claim(FakeClaimTypes.UserId, mapId.Value.ToString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
claims.RemoveAll(x => x.Type == SimpleOmsClaimTypes.LoginType);
|
|
||||||
claims.Add(new Claim(SimpleOmsClaimTypes.LoginType, "0"));
|
|
||||||
return claims;
|
return claims;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user