You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
771 B

10 months ago
using HuiXin.Gateway.Ocelot.Configurations;
using Microsoft.Extensions.Options;
using Ocelot.Infrastructure.Claims.Parser;
using Ocelot.Responses;
namespace HuiXin.Gateway.Ocelot.Authorizers
{
public class RolesAuthorizerBase
{
protected readonly IClaimsParser _claimsParser;
protected RolesAuthorizerConfiguration _configs;
public RolesAuthorizerBase(IClaimsParser claimsParser, IOptions<RolesAuthorizerConfiguration> cfg)
{
_claimsParser = claimsParser;
_configs = cfg.Value ?? throw new Exception("未配置角色验证参数");
}
protected async Task<Response<T>> ReturnAsync<T>(Response<T> response)
{
return await Task.FromResult(response);
}
}
}