Bladeren bron

提交进件的文件从网络获取

lcl 1 jaar geleden
bovenliggende
commit
7e7bbd3440
4 gewijzigde bestanden met toevoegingen van 20 en 9 verwijderingen
  1. 5 5
      AppStart/Alipay/AlipayFunction.cs
  2. 5 4
      AppStart/WeChatFunction.cs
  3. 9 0
      Config/Base.cs
  4. 1 0
      appsettings.json

+ 5 - 5
AppStart/Alipay/AlipayFunction.cs

@@ -159,14 +159,14 @@ namespace MySystem
             }
             if (!string.IsNullOrEmpty(BusinessLicensePicPath))
             {
-                FileItem BusinessLicensePic = new FileItem(function.getPath(BusinessLicensePicPath));
+                FileItem BusinessLicensePic = PublicFunction.GetNetFileItem(AppConfig.Base.OssHost + BusinessLicensePicPath);
                 request.BusinessLicensePic = BusinessLicensePic; //营业执照图片。被代创建商户运营主体为个人账户必填,企业账户无需填写
-                FileItem BusinessLicenseAuthPic = new FileItem(function.getPath(BusinessLicensePicPath));
+                FileItem BusinessLicenseAuthPic = PublicFunction.GetNetFileItem(AppConfig.Base.OssHost + BusinessLicensePicPath);
                 request.BusinessLicenseAuthPic = BusinessLicenseAuthPic;
             }
             if (!string.IsNullOrEmpty(SpecialLicensePicPath))
             {
-                FileItem SpecialLicensePic = new FileItem(function.getPath(SpecialLicensePicPath));
+                FileItem SpecialLicensePic = PublicFunction.GetNetFileItem(AppConfig.Base.OssHost + SpecialLicensePicPath);
                 request.SpecialLicensePic = SpecialLicensePic;
             }
             if (!string.IsNullOrEmpty(ShopScenePicPath))
@@ -175,7 +175,7 @@ namespace MySystem
                 {
                     ShopScenePicPath = ShopScenePicPath.Split(',')[0];
                 }
-                FileItem ShopScenePic = new FileItem(function.getPath(ShopScenePicPath));
+                FileItem ShopScenePic = PublicFunction.GetNetFileItem(AppConfig.Base.OssHost + ShopScenePicPath);
                 request.ShopScenePic = ShopScenePic;
             }
             if (!string.IsNullOrEmpty(ShopSignBoardPicPath))
@@ -184,7 +184,7 @@ namespace MySystem
                 {
                     ShopSignBoardPicPath = ShopSignBoardPicPath.Split(',')[0];
                 }
-                FileItem ShopSignBoardPic = new FileItem(function.getPath(ShopSignBoardPicPath));
+                FileItem ShopSignBoardPic = PublicFunction.GetNetFileItem(AppConfig.Base.OssHost + ShopSignBoardPicPath);
                 request.ShopSignBoardPic = ShopSignBoardPic;
             }
             // FileItem SpecialLicensePic = new FileItem("C:/Downloads/ooopic_963991_7eea1f5426105f9e6069/16365_1271139700.jpg");

+ 5 - 4
AppStart/WeChatFunction.cs

@@ -540,10 +540,11 @@ namespace MySystem
             }
             string filePath = function.getPath(imgPath);
             var filename = Path.GetFileName(filePath);
-            FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);
-            Byte[] imgBytesIn = new Byte[fs.Length];
-            fs.Read(imgBytesIn, 0, imgBytesIn.Length);
-            fs.Close();
+            // FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);
+            // Byte[] imgBytesIn = new Byte[fs.Length];
+            // fs.Read(imgBytesIn, 0, imgBytesIn.Length);
+            // fs.Close();
+            byte[] imgBytesIn = PublicFunction.GetNetFileData(AppConfig.Base.OssHost + imgPath);
 
             byte[] hash = SHA256Managed.Create().ComputeHash(imgBytesIn);
 

+ 9 - 0
Config/Base.cs

@@ -0,0 +1,9 @@
+using Library;
+
+namespace AppConfig
+{
+    public class Base
+    {
+        public static string OssHost = ConfigurationManager.AppSettings["OssHost"].ToString();
+    }
+}

+ 1 - 0
appsettings.json

@@ -16,6 +16,7 @@
     "DbSchemeUrl": "",
     "Host": "http://localhost:5303/",
     "SourceHost": "http://main.qrcodeplate.com/",
+    "OssHost": "http://oss.kxssaas.com",
     "Database": "QrCodePlateMainServer",
     "SqlConnStr": "server=rm-2vc27k81v217qs1t55o.mysql.cn-chengdu.rds.aliyuncs.com;port=3306;user=QrCodePlateMainServer;password=ll4DFaALMu9YIooM;database=QrCodePlateMainServer;charset=utf8;",
     "SqlConnStr2": "server=rm-2vc27k81v217qs1t55o.mysql.cn-chengdu.rds.aliyuncs.com;port=3306;user=QrCodePlateMainServer;password=ll4DFaALMu9YIooM;database=QrCodePlateMainServer2;charset=utf8;",