From 8476e4ac50a83fefe1cb11a772ac9dde682713ba Mon Sep 17 00:00:00 2001 From: wxhuang <85202736@qq.com> Date: Fri, 19 Jun 2015 09:56:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=9B=9E=E5=A4=8D=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=B6=88=E6=81=AF=E4=B8=BA=E4=BA=8C=E8=BF=9B=E5=88=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=97=B6=E4=B9=B1=E7=A0=81=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/wechat.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/wechat.js b/lib/wechat.js index 8e44455f..640e585d 100644 --- a/lib/wechat.js +++ b/lib/wechat.js @@ -191,7 +191,10 @@ var reply = function (content, fromUsername, toUsername, message) { delete info.content; info.DeviceStatus = isNaN(content) ? 0 : content; } else { - info.content = new Buffer(String(content)).toString('base64'); + if (!(content instanceof Buffer)) { + content = String(content); + } + info.content = new Buffer(content).toString('base64'); } type = message.MsgType; if (message.MsgType === 'device_event') {