@gaoding/co-wechat
Advanced tools
Comparing version 2.3.0 to 2.3.1
@@ -272,20 +272,18 @@ 'use strict'; | ||
ctx.body = ''; | ||
return; | ||
} | ||
} else { | ||
var replyMessageXml = reply(body, formatted.ToUserName, formatted.FromUserName); | ||
var replyMessageXml = reply(body, formatted.ToUserName, formatted.FromUserName); | ||
if (!query.encrypt_type || query.encrypt_type === 'raw') { | ||
ctx.body = replyMessageXml; | ||
} else { | ||
var wrap = {}; | ||
wrap.encrypt = CRYPTOR.encrypt(replyMessageXml); | ||
wrap.nonce = parseInt((Math.random() * 100000000000), 10); | ||
wrap.timestamp = new Date().getTime(); | ||
wrap.signature = CRYPTOR.getSignature(wrap.timestamp, wrap.nonce, wrap.encrypt); | ||
ctx.body = encryptWrap(wrap); | ||
if (!query.encrypt_type || query.encrypt_type === 'raw') { | ||
ctx.body = replyMessageXml; | ||
} else { | ||
var wrap = {}; | ||
wrap.encrypt = CRYPTOR.encrypt(replyMessageXml); | ||
wrap.nonce = parseInt((Math.random() * 100000000000), 10); | ||
wrap.timestamp = new Date().getTime(); | ||
wrap.signature = CRYPTOR.getSignature(wrap.timestamp, wrap.nonce, wrap.encrypt); | ||
ctx.body = encryptWrap(wrap); | ||
} | ||
ctx.type = 'application/xml'; | ||
} | ||
ctx.type = 'application/xml'; | ||
if(next) { | ||
@@ -292,0 +290,0 @@ return await next(); |
{ | ||
"name": "@gaoding/co-wechat", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "wechat api for co", | ||
@@ -5,0 +5,0 @@ "main": "lib/wechat.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17496