Explorar el Código

修改推送加密方式,多加一层base64

lcl hace 6 meses
padre
commit
888e87ee7b
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. 1 1
      AppStart/StartHelper.cs
  2. 2 1
      Util/Queue/PosPushHelper.cs

+ 1 - 1
AppStart/StartHelper.cs

@@ -24,7 +24,7 @@
             }
             else
             {
-                AliyunPushHelper.Instance.Start(); //阿里云消息推送
+                PosPushHelper.Instance.Start(); //推送机具数据
             }
         }
     }

+ 2 - 1
Util/Queue/PosPushHelper.cs

@@ -55,13 +55,14 @@ namespace MySystem
             string url = "";
             JsonData jsonObj = JsonMapper.ToObject(content);
             string dataType = jsonObj["data_type"].ToString();
-            string dataContent = jsonObj["data_content"].ToString();
+            string dataContent = jsonObj["data_content"].ToJson();
             if(dataType == "bind") url = "http://gateway.kexiaoshuang.com/v1/kxs/statServer/sp/binding";
             if(dataType == "un_bind") url = "http://gateway.kexiaoshuang.com/v1/kxs/statServer/sp/unbind";
             if(dataType == "trade") url = "http://gateway.kexiaoshuang.com/v1/kxs/statServer/sp/trade";
             if(dataType == "deposit") url = "http://gateway.kexiaoshuang.com/v1/kxs/statServer/sp/cash";
             if(dataType == "active") url = "http://gateway.kexiaoshuang.com/v1/kxs/statServer/sp/extActData";
             string encryptContent = AesEncrypt(dataContent);
+            encryptContent = Convert.ToBase64String(Encoding.UTF8.GetBytes(encryptContent));
             string res = PostWebRequest(url, encryptContent, new Dictionary<string, string>());
             if(!res.Contains("\"status\""))
             {