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

处理方式与reportMessage相同。

Jeff 3 жил өмнө
parent
commit
0c2dbcdd9e

+ 12 - 2
FactoryTool_CShare/Business/CommonMethod.cs

@@ -367,17 +367,28 @@ namespace MOKA_Factory_Tools
         /// <returns></returns>
         public static bool GetMidAddress2(MidList midInfo, string order, SQLiteConnection sqliteConn, out List<MidAddress> midAddressList)
         {
+            #region 新抄写接口预处理
+            string url = midInfo.host;
+            // 逆序去除第一个斜杠后的字符,再拼接"IDManage"
+            int nPos = url.LastIndexOf('/');
+            if (nPos > 0)
+            {
+                url = url.Substring(0, nPos) + "/IDManage";
+            }
+            #endregion
+
             midAddressList = new List<MidAddress>();
             HttpHelper http = new HttpHelper();
             HttpItem item = new HttpItem()
             {
-                URL = midInfo.host + "/getofflinelist.do?",//URL这里都是测试URl   必需项
+                URL = url + "/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
             };
+            
             item.ContentType = "application/x-www-form-urlencoded";
             HttpResult result = http.GetHtml(item);
             string ParseText = result.Html;
@@ -425,7 +436,6 @@ namespace MOKA_Factory_Tools
                 MessageBox.Show("Fail to parse MIDAddress info\r\n " + ex.Message);
                 return false;
             }
-
         }
 
         /// <summary>