ソースを参照

修复新掊口变更中,部分旧接口保持不变。

JeffWang 3 年 前
コミット
6ab69a7c3c
1 ファイル変更28 行追加4 行削除
  1. 28 4
      FactoryTool_CShare/Business/CommonMethod.cs

+ 28 - 4
FactoryTool_CShare/Business/CommonMethod.cs

@@ -501,13 +501,21 @@ namespace MOKA_Factory_Tools
             HttpHelper http = new HttpHelper();
             HttpItem item = new HttpItem()
             {
-                URL = midInfo.host + "/getofflinelist.do?",//URL这里都是测试URl   必需项
                 Encoding = null,//编码格式(utf-8,gb2312,gbk)     可选项 默认类会自动识别
                                 //Encoding = Encoding.Default,
                 Method = "post",//URL     可选项 默认为Get
                 Postdata = ("orderNumber=" + order + "&mac=" + HttpUtility.UrlEncode(TestMode.MAC)),
                 KeepAlive = false
             };
+            #region 新接口统一返回带/v1,getofflinelist.do依旧采用旧host地址;
+            string url = midInfo.host;
+            if (url.EndsWith("/v1"))
+            {
+                url = url.Replace("/v1", "");
+            }
+
+            item.URL = url + "/getofflinelist.do?";
+            #endregion
             item.ContentType = "application/x-www-form-urlencoded";
             HttpResult result = http.GetHtml(item);
             string ParseText = result.Html;
@@ -562,14 +570,23 @@ namespace MOKA_Factory_Tools
             HttpHelper http = new HttpHelper();
             HttpItem item = new HttpItem()
             {
-                URL = midInfo.host + "/getofflinelist.do?",//URL这里都是测试URl   必需项
                 Encoding = null,//编码格式(utf-8,gb2312,gbk)     可选项 默认类会自动识别
                                 //Encoding = Encoding.Default,
                 Method = "post",//URL     可选项 默认为Get
                 Postdata = ("orderNumber=" + order + "&mac=" + HttpUtility.UrlEncode(TestMode.MAC)),
                 KeepAlive = false
             };
-            
+
+            #region 新接口统一返回带/v1,getofflinelist.do依旧采用旧host地址;
+            string url = midInfo.host;
+            if (url.EndsWith("/v1"))
+            {
+                url = url.Replace("/v1", "");
+            }
+
+            item.URL = url + "/getofflinelist.do?";
+            #endregion
+
             item.ContentType = "application/x-www-form-urlencoded";
             HttpResult result = http.GetHtml(item);
             string ParseText = result.Html;
@@ -1069,13 +1086,20 @@ end:
             HttpHelper http = new HttpHelper();
             HttpItem item = new HttpItem()
             {
-                URL = url + "/getreportofflinesn.do?",//URL这里都是测试URl   必需项
                 Encoding = null,//编码格式(utf-8,gb2312,gbk)     可选项 默认类会自动识别
                                 //Encoding = Encoding.Default,
                 Method = "post",//URL     可选项 默认为Get
                 Postdata = ("orderNumber =" + order),
                 KeepAlive = false
             };
+            #region 新接口统一返回带/v1,getreportofflinesn.do依旧采用旧host地址;
+            if (url.EndsWith("/v1"))
+            {
+                url = url.Replace("/v1", "");
+            }
+
+            url += "/getreportofflinesn.do?";
+            #endregion
             item.ContentType = "application/x-www-form-urlencoded";
             HttpResult result = http.GetHtml(item);
             string ParseText = result.Html;