Skip to content

Commit

Permalink
+ .parseResponseBody
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Jul 5, 2017
1 parent ffea3fa commit 6534d9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 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",
Expand Down
7 changes: 4 additions & 3 deletions src/index.js
Expand Up @@ -139,9 +139,10 @@ function getJSSDKApiTicket(callback) {
/**
* 解析内容为 JSON 对象
* @param body
* @param callback
* @returns {*}
*/
function parseResponseBody(body) {
function parseResponseBody(body, callback) {
var ret = {};

try {
Expand Down Expand Up @@ -181,7 +182,7 @@ function parseResponseBody(body) {
ret.avatar = ret.headimgurl;
}

return ret;
callback(null, ret);
}


Expand All @@ -197,7 +198,7 @@ function parseResponseCallback(callback) {
return callback(err);
}

callback(null, parseResponseBody(body));
parseResponseBody(body, callback);
};
}

Expand Down

0 comments on commit 6534d9c

Please sign in to comment.