5 changed files with 19 additions and 39 deletions
@ -1,34 +1,11 @@ |
|||||
using System; |
namespace LINGYUN.Abp.OpenApi |
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Text; |
|
||||
|
|
||||
namespace LINGYUN.Abp.OpenApi |
|
||||
{ |
{ |
||||
public class AbpOpenApiOptions |
public class AbpOpenApiOptions |
||||
{ |
{ |
||||
public bool IsEnabled { get; set; } |
public bool IsEnabled { get; set; } |
||||
public string[] WhiteIpAddress { get; set; } |
|
||||
public string[] WhiteClient { get; set; } |
|
||||
public AbpOpenApiOptions() |
public AbpOpenApiOptions() |
||||
{ |
{ |
||||
IsEnabled = true; |
IsEnabled = true; |
||||
WhiteIpAddress = new string[0]; |
|
||||
WhiteClient = new string[0]; |
|
||||
} |
|
||||
|
|
||||
public bool HasWhiteIpAddress(string ipAddress) |
|
||||
{ |
|
||||
return WhiteIpAddress?.Contains(ipAddress) == true; |
|
||||
} |
|
||||
|
|
||||
public bool HasWhiteClient(string clientId) |
|
||||
{ |
|
||||
if (clientId.IsNullOrWhiteSpace()) |
|
||||
{ |
|
||||
return false; |
|
||||
} |
|
||||
return WhiteClient?.Contains(clientId) == true; |
|
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue