ow
This commit is contained in:
1 parent
59ec58a1eb
commit
53184877cd
3 files changed
+20
-1
No files matched your search
@@ -26,6 +26,7 @@ namespace CloudBuilder.Security.Policy
|
||||
|
||||
// 身份证 OCR 识别服务(server-to-server 调用,地址来自 appsettings.json,避免写死)
|
||||
public const string IdCardOcrApiUrl = "IdCardOcr:ApiUrl";
|
||||
public const string IdCardOcrApiKey = "IdCardOcr:ApiKey";
|
||||
public const string IdCardOcrSide = "IdCardOcr:Side";
|
||||
public const string IdCardOcrTimeoutSeconds = "IdCardOcr:TimeoutSeconds";
|
||||
|
||||
@@ -34,6 +35,12 @@ namespace CloudBuilder.Security.Policy
|
||||
return service.Configuration[IdCardOcrApiUrl];
|
||||
}
|
||||
|
||||
// OCR 服务已启用 Bearer Token 鉴权(API_TOKENS 中 win-service 专用 Token),未配置时返回空串表示不带认证头
|
||||
public static string GetIdCardOcrApiKey(IApplicationService service)
|
||||
{
|
||||
return service.Configuration[IdCardOcrApiKey];
|
||||
}
|
||||
|
||||
public static string GetIdCardOcrSide(IApplicationService service)
|
||||
{
|
||||
var side = service.Configuration[IdCardOcrSide];
|
||||
|
||||
Reference in new issue
Block a user