Эх сурвалжийг харах

拦截器新接口主机头配置到appsetting

lcl 1 жил өмнө
parent
commit
abee8d3ad7

+ 1 - 0
Config/Base.cs

@@ -7,6 +7,7 @@ namespace AppConfig
     {
         public static string ApiKey = "G6H7@J8%";
         public static string Host = Library.ConfigurationManager.AppSettings["Host"].ToString();
+        public static string Host2 = Library.ConfigurationManager.AppSettings["Host2"].ToString();
         public static string Database = Library.ConfigurationManager.AppSettings["Database"].ToString();
         public static string defaultImage = Library.ConfigurationManager.AppSettings["Host"].ToString() + "/skin/app/default/static/images/default.jpg";
         

+ 1 - 1
Filter/GlobalActionFilter.cs

@@ -25,7 +25,7 @@ namespace MySystem
                 string path = context.ActionDescriptor.AttributeRouteInfo.Template.ToLower();
                 if(keyValue.Key == "value" && AllowApiList().Contains(path))
                 {
-                    string result = function.PostWebRequest("https://test.mpap2.kexiaoshuang.com/" + path, "value=" + keyValue.Value.ToString());
+                    string result = function.PostWebRequest(AppConfig.Base.Host2 + path, "value=" + keyValue.Value.ToString());
                     result = result.Replace("null", "\"\"");
                     result = result.Replace("\"status\"", "\"Status\"");
                     result = result.Replace("\"data\"", "\"Data\"");

+ 1 - 0
appsettings.json

@@ -10,6 +10,7 @@
   "Setting": {
     "ConnectionStrings": "",
     "Host": "http://test.mpap.kexiaoshuang.com/",
+    "Host2": "http://test.mpap2.kexiaoshuang.com/",
     "SourceHost": "http://test.mpap.kexiaoshuang.com/",
     "SpHost": "http://mpsp.kexiaoshuang.com/",
     "OssHost": "http://oss.qrcodeplate.com",