Browse Source

静态资源本地获取

lcl 1 year ago
parent
commit
24a535d806
2 changed files with 15 additions and 10 deletions
  1. 10 5
      AppStart/Alipay/AlipayFunction.cs
  2. 5 5
      AppStart/WeChatFunction.cs

+ 10 - 5
AppStart/Alipay/AlipayFunction.cs

@@ -159,14 +159,17 @@ namespace MySystem
             }
             if (!string.IsNullOrEmpty(BusinessLicensePicPath))
             {
-                FileItem BusinessLicensePic = PublicFunction.GetNetFileItem(AppConfig.Base.OssHost + BusinessLicensePicPath);
+                FileItem BusinessLicensePic = new FileItem(function.getPath(BusinessLicensePicPath));
+                // FileItem BusinessLicensePic = PublicFunction.GetNetFileItem(AppConfig.Base.OssHost + BusinessLicensePicPath);
                 request.BusinessLicensePic = BusinessLicensePic; //营业执照图片。被代创建商户运营主体为个人账户必填,企业账户无需填写
-                FileItem BusinessLicenseAuthPic = PublicFunction.GetNetFileItem(AppConfig.Base.OssHost + BusinessLicensePicPath);
+                FileItem BusinessLicenseAuthPic = new FileItem(function.getPath(BusinessLicensePicPath));
+                // FileItem BusinessLicenseAuthPic = PublicFunction.GetNetFileItem(AppConfig.Base.OssHost + BusinessLicensePicPath);
                 request.BusinessLicenseAuthPic = BusinessLicenseAuthPic;
             }
             if (!string.IsNullOrEmpty(SpecialLicensePicPath))
             {
-                FileItem SpecialLicensePic = PublicFunction.GetNetFileItem(AppConfig.Base.OssHost + 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 +178,8 @@ namespace MySystem
                 {
                     ShopScenePicPath = ShopScenePicPath.Split(',')[0];
                 }
-                FileItem ShopScenePic = PublicFunction.GetNetFileItem(AppConfig.Base.OssHost + ShopScenePicPath);
+                FileItem ShopScenePic = new FileItem(function.getPath(ShopScenePicPath));
+                // FileItem ShopScenePic = PublicFunction.GetNetFileItem(AppConfig.Base.OssHost + ShopScenePicPath);
                 request.ShopScenePic = ShopScenePic;
             }
             if (!string.IsNullOrEmpty(ShopSignBoardPicPath))
@@ -184,7 +188,8 @@ namespace MySystem
                 {
                     ShopSignBoardPicPath = ShopSignBoardPicPath.Split(',')[0];
                 }
-                FileItem ShopSignBoardPic = PublicFunction.GetNetFileItem(AppConfig.Base.OssHost + ShopSignBoardPicPath);
+                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 - 5
AppStart/WeChatFunction.cs

@@ -540,11 +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();
-            byte[] imgBytesIn = PublicFunction.GetNetFileData(AppConfig.Base.OssHost + imgPath);
+            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);