|
@@ -609,7 +609,21 @@ namespace MOKA_Factory_Tools
|
|
|
AddKeyJson2(keyinfo.KFP, postJson, "kfp");
|
|
|
}
|
|
|
|
|
|
- return postJson.ToString();
|
|
|
+ string postData = postJson.ToString();
|
|
|
+ //需要加密上报的话
|
|
|
+ if (midList != null && midList.aesEncrypt)
|
|
|
+ {
|
|
|
+ AES_DES AES_DES = new AES_DES();
|
|
|
+ string key = AES_DES.AESKey;
|
|
|
+ byte[] IV = AES_DES.AESIV;
|
|
|
+ postData = AES_DES.EncryptStringToBytes_Aes(postData, key, IV);
|
|
|
+ //json
|
|
|
+ string Data = string.Format("{{\"reportData\":\"{0}\"}}", postData);
|
|
|
+ JObject jo = JObject.Parse(Data);
|
|
|
+ postData = jo.ToString();
|
|
|
+ }
|
|
|
+
|
|
|
+ return postData;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -635,18 +649,6 @@ namespace MOKA_Factory_Tools
|
|
|
if (timeout < 5000)
|
|
|
timeout = 5000;
|
|
|
HttpHelper http = new HttpHelper();
|
|
|
- //需要加密上报的话
|
|
|
- if (midList != null && midList.aesEncrypt)
|
|
|
- {
|
|
|
- AES_DES AES_DES = new AES_DES();
|
|
|
- string key = AES_DES.AESKey;
|
|
|
- byte[] IV = AES_DES.AESIV;
|
|
|
- postData = AES_DES.EncryptStringToBytes_Aes(postData, key, IV);
|
|
|
- //json
|
|
|
- string Data = string.Format("{{\"reportData\":\"{0}\"}}", postData);
|
|
|
- JObject jo = JObject.Parse(Data);
|
|
|
- postData = jo.ToString();
|
|
|
- }
|
|
|
HttpItem item = new HttpItem()
|
|
|
{
|
|
|
Encoding = Encoding.UTF8,//编码格式(utf-8,gb2312,gbk)可选项 默认类会自动识别//Encoding = Encoding.Default,
|