Parcourir la source

静态资源放oss

lcl il y a 1 an
Parent
commit
9e32355ac4

+ 10 - 10
AppStart/Alipay/AlipayFunction.cs

@@ -159,17 +159,17 @@ namespace MySystem
             }
             if (!string.IsNullOrEmpty(BusinessLicensePicPath))
             {
-                FileItem BusinessLicensePic = new FileItem(function.getPath(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 = new FileItem(function.getPath(BusinessLicensePicPath));
-                // 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 = new FileItem(function.getPath(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))
@@ -178,8 +178,8 @@ namespace MySystem
                 {
                     ShopScenePicPath = ShopScenePicPath.Split(',')[0];
                 }
-                FileItem ShopScenePic = new FileItem(function.getPath(ShopScenePicPath));
-                // 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))
@@ -188,8 +188,8 @@ namespace MySystem
                 {
                     ShopSignBoardPicPath = ShopSignBoardPicPath.Split(',')[0];
                 }
-                FileItem ShopSignBoardPic = new FileItem(function.getPath(ShopSignBoardPicPath));
-                // 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);
 

+ 1 - 0
appsettings.Development.json

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

+ 1 - 1
appsettings.json

@@ -16,7 +16,7 @@
     "DbSchemeUrl": "",
     "Host": "http://localhost:5303/",
     "SourceHost": "http://main.qrcodeplate.com/",
-    "OssHost": "http://oss.kxssaas.com",
+    "OssHost": "https://laikeba.oss-cn-chengdu.aliyuncs.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;",