Преглед на файлове

运营接口变更:新接口返回带/v1,但report.do依然使用原host,所以要去除host中的/v1。

JeffWang преди 3 години
родител
ревизия
f64a85c9ca
променени са 2 файла, в които са добавени 11 реда и са изтрити 4 реда
  1. 8 1
      FactoryTool_CShare/Business/CommonMethod.cs
  2. 3 3
      FactoryTool_CShare/Views/OperationPanel.cs

+ 8 - 1
FactoryTool_CShare/Business/CommonMethod.cs

@@ -1051,7 +1051,14 @@ end:
                 KeepAlive = false
             };
             item.PostEncoding = Encoding.UTF8;
-            item.URL = url;
+            #region 新接口统一返回带/v1,report.do依旧采用旧host地址;
+            if ( url.EndsWith("/v1") )
+            {
+                url = url.Replace("/v1", "");
+            }
+
+            item.URL = url + "/report.do?";
+            #endregion
             item.Postdata = content;
             System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
             stopwatch.Start();

+ 3 - 3
FactoryTool_CShare/Views/OperationPanel.cs

@@ -4770,7 +4770,7 @@ namespace MOKA_Factory_Tools
             {// 在线抄写;
                 if (WriteDID.Checked)
                 {
-                    if (CommonMethod.UploadCopyResult(keycontent + "sversionid=" + midListNow.version + "&clienttype=" + midListNow.clienttype + "&ordernum=" + orderNow, midListNow.host + "/report.do?", errorDBNow, orderNow, false, "", FunctionSettingNow.ReportTimeOut))
+                    if (CommonMethod.UploadCopyResult(keycontent + "sversionid=" + midListNow.version + "&clienttype=" + midListNow.clienttype + "&ordernum=" + orderNow, midListNow.host, errorDBNow, orderNow, false, "", FunctionSettingNow.ReportTimeOut))
                         TestResult = 1;
                     else
                     {
@@ -4787,7 +4787,7 @@ namespace MOKA_Factory_Tools
                     if (SN.Trim().Length > 0)
                     {
                         keycontent += "nodid=true&";
-                        if (CommonMethod.UploadCopyResult(keycontent + "sversionid=" + midListNow.version + "&clienttype=" + midListNow.clienttype + "&ordernum=" + orderNow, midListNow.host + "/report.do?", errorDBNow, orderNow, false, "", FunctionSettingNow.ReportTimeOut))
+                        if (CommonMethod.UploadCopyResult(keycontent + "sversionid=" + midListNow.version + "&clienttype=" + midListNow.clienttype + "&ordernum=" + orderNow, midListNow.host, errorDBNow, orderNow, false, "", FunctionSettingNow.ReportTimeOut))
                             TestResult = 1;
                         else
                         {
@@ -4801,7 +4801,7 @@ namespace MOKA_Factory_Tools
                     }
                     else
                     {
-                        LocalTxtRecord.LocalRecord(midListNow.host + "/report.do?\r\n" + keycontent + "sversionid=" + midListNow.version + "&clienttype=" + midListNow.clienttype + "&ordernum=" + orderNow + "\r\n\r\n", orderNow);
+                        LocalTxtRecord.LocalRecord(midListNow.host + "/v1/report.do?\r\n" + keycontent + "sversionid=" + midListNow.version + "&clienttype=" + midListNow.clienttype + "&ordernum=" + orderNow + "\r\n\r\n", orderNow);
                         if (FunctionSettingNow.AllowNoScanning)
                         {
                             TestResult = 1;