diff --git a/package.json b/package.json index 9013a0a..39936a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blear.node.weixin", - "version": "2.0.2", + "version": "2.0.3", "description": "微信授权登录、JSSDK", "scripts": { "live": "browser-sync start --config bs-config.js", diff --git a/src/index.js b/src/index.js index 4f63197..cfbae70 100644 --- a/src/index.js +++ b/src/index.js @@ -139,9 +139,10 @@ function getJSSDKApiTicket(callback) { /** * 解析内容为 JSON 对象 * @param body + * @param callback * @returns {*} */ -function parseResponseBody(body) { +function parseResponseBody(body, callback) { var ret = {}; try { @@ -181,7 +182,7 @@ function parseResponseBody(body) { ret.avatar = ret.headimgurl; } - return ret; + callback(null, ret); } @@ -197,7 +198,7 @@ function parseResponseCallback(callback) { return callback(err); } - callback(null, parseResponseBody(body)); + parseResponseBody(body, callback); }; }