|
|
@@ -3,8 +3,7 @@ using AlibabaCloud.SDK.ImageSearch20210501.Models;
|
|
|
using AlibabaCloud.SDK.ImageSearch20210501;
|
|
|
using Tea;
|
|
|
using dodohold.core;
|
|
|
-using COSXML.Network;
|
|
|
-using TencentCloud.Scf.V20180416.Models;
|
|
|
+using Environment = System.Environment;
|
|
|
|
|
|
|
|
|
namespace molilian.core
|
|
|
@@ -12,6 +11,16 @@ namespace molilian.core
|
|
|
|
|
|
public partial class AliyunPlus
|
|
|
{
|
|
|
+ private static string _end_point;
|
|
|
+ static AliyunPlus()
|
|
|
+ {
|
|
|
+ _end_point = Environment.GetEnvironmentVariable("IMG_EndPoint");
|
|
|
+ if (string.IsNullOrEmpty(_end_point))
|
|
|
+ {
|
|
|
+ _end_point = "imagesearch-vpc.cn-shanghai.aliyuncs.com";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public SearchByPicResponse SearchByPic(string base64String, string pid)
|
|
|
{
|
|
|
@@ -28,7 +37,7 @@ namespace molilian.core
|
|
|
AccessKeyId = _app_key,
|
|
|
AccessKeySecret = _app_secret,
|
|
|
//Endpoint = "imagesearch.cn-shanghai.aliyuncs.com",
|
|
|
- Endpoint = "imagesearch.cn-shanghai.aliyuncs.com",
|
|
|
+ Endpoint = _end_point,
|
|
|
RegionId = "cn-shanghai"
|
|
|
};
|
|
|
Client client = new(config);
|