Skip to content

Commit

Permalink
修复getFollowers的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Nov 23, 2013
1 parent 0423b4b commit d7343e3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/common.js
Expand Up @@ -6,7 +6,6 @@ var formstream = require('formstream');
// http://mp.weixin.qq.com/wiki/index.php?title=%E8%BF%94%E5%9B%9E%E7%A0%81%E8%AF%B4%E6%98%8E
var wrapper = function (callback) {
return function (err, data, res) {

if (err) {
err.name = 'WeChatAPI' + err.name;
return callback(err, data, res);
Expand Down Expand Up @@ -475,7 +474,10 @@ API.prototype.getFollowers = function (nextOpenid, callback) {
callback = nextOpenid;
nextOpenid = '';
}
var url = this.prefix + 'user/info?next_openid=' + nextOpenid + '&access_token=' + this.token;
var url = this.prefix + 'user/info?access_token=' + this.token;
if (nextOpenid) {
url += '&next_openid=' + nextOpenid;
}
urllib.request(url, {dataType: 'json'}, wrapper(callback));
};

Expand Down

0 comments on commit d7343e3

Please sign in to comment.