add wx code.
Some checks failed
Deploy / Build (push) Failing after 15s

This commit is contained in:
2025-06-04 19:13:43 +08:00
parent edab6cfa30
commit f909dc4581
3 changed files with 34 additions and 7 deletions

View File

@ -76,7 +76,7 @@ int WXBizMsgCrypt::DecryptMsg(const std::string &sMsgSignature, const std::strin
boost::property_tree::ptree ptree;
std::istringstream iss(sPostData);
boost::property_tree::read_xml(iss, ptree);
std::string sEncryptMsg = ptree.get<std::string>("Encrypt");
std::string sEncryptMsg = ptree.get<std::string>("xml.Encrypt");
// 2.validate signature
if (0 != ValidateSignature(sMsgSignature, sTimeStamp, sNonce, sEncryptMsg)) {
@ -390,10 +390,10 @@ void WXBizMsgCrypt::GenNeedEncryptData(const std::string &sReplyMsg, std::string
int WXBizMsgCrypt::GenReturnXml(const std::string &sEncryptMsg, const std::string &sSignature, const std::string &sTimeStamp,
const std::string &sNonce, std::string &sResult) {
boost::property_tree::ptree ptree;
ptree.put("Encrypt", sEncryptMsg);
ptree.put("MsgSignature", sSignature);
ptree.put("TimeStamp", sTimeStamp);
ptree.put("Nonce", sNonce);
ptree.put("xml.Encrypt", sEncryptMsg);
ptree.put("xml.MsgSignature", sSignature);
ptree.put("xml.TimeStamp", sTimeStamp);
ptree.put("xml.Nonce", sNonce);
std::ostringstream oss;
boost::property_tree::write_xml(oss, ptree);