浏览代码

新接口要求:GetMessage接口返回的接口有变化,与旧版本存在差异:reportmessage时,需要删除倒逆斜杠后面部分'n-admin'并再拼接回IDManage

Jeff 3 年之前
父节点
当前提交
fe40ef94f0
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      FactoryTool_CShare/Business/CommonMethod.cs

+ 8 - 0
FactoryTool_CShare/Business/CommonMethod.cs

@@ -907,6 +907,14 @@ namespace MOKA_Factory_Tools
                 KeepAlive = false
             };
             item.PostEncoding = Encoding.UTF8;
+            #region 新抄写接口预处理
+            // 逆序去除第一个斜杠后的字符,再拼接"IDManage"
+            int nPos = url.LastIndexOf('/');
+            if (nPos > 0)
+            {
+                url = url.Substring(0, nPos) + "/IDManage";
+            }
+            #endregion
             item.URL = url;
             item.Postdata = content;
             System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();