|
@@ -150,7 +150,7 @@ namespace MOKA_Factory_Tools
|
|
|
mid.clienttype = jObject["clientType"].Value<string>();
|
|
|
mid.host = jObject["host"].Value<string>();
|
|
|
mid.whiteType = jObject["whiteType"].Value<string>();
|
|
|
- mid.aesEncrypt = jObject["aesEncrypt"].Value<string>();
|
|
|
+ mid.aesEncrypt = jObject["aesEncrypt"] == null ? false : jObject["aesEncrypt"].Value<string>().Equals("yes", StringComparison.OrdinalIgnoreCase);
|
|
|
object a = jObject["rokuCustomer"];
|
|
|
if (jObject["rokuCustomer"].ToString().Length > 0)
|
|
|
{
|
|
@@ -213,7 +213,7 @@ namespace MOKA_Factory_Tools
|
|
|
if (code == "0")
|
|
|
{
|
|
|
//需要解密
|
|
|
- if (midList != null && midList.aesEncrypt.Equals("yes", StringComparison.InvariantCultureIgnoreCase))
|
|
|
+ if (midList != null && midList.aesEncrypt)
|
|
|
{
|
|
|
AES_DES Aes = new AES_DES();
|
|
|
//data解密
|
|
@@ -221,6 +221,7 @@ namespace MOKA_Factory_Tools
|
|
|
string key = AES_DES.AESKey;
|
|
|
byte[] IV = AES_DES.AESIV;
|
|
|
string str = AES_DES.DecryptStringFromBytes_Aes(plainText, key, IV);
|
|
|
+ Log.WriteInfoLog("解密后:" + str);
|
|
|
jObject["data"] = str;
|
|
|
}
|
|
|
Dictionary<string, string> data = JsonConvert.DeserializeObject<Dictionary<string, string>>(jObject["data"].ToString());
|
|
@@ -634,7 +635,7 @@ namespace MOKA_Factory_Tools
|
|
|
timeout = 5000;
|
|
|
HttpHelper http = new HttpHelper();
|
|
|
//需要加密上报的话
|
|
|
- if (midList != null && midList.aesEncrypt.Equals("yes", StringComparison.InvariantCultureIgnoreCase))
|
|
|
+ if (midList != null && midList.aesEncrypt)
|
|
|
{
|
|
|
AES_DES AES_DES = new AES_DES();
|
|
|
string key = AES_DES.AESKey;
|