Skip to content

Commit

Permalink
Merge branch 'hotfix/fix_jsapi_ticket'
Browse files Browse the repository at this point in the history
  • Loading branch information
doraemonext committed Feb 5, 2016
2 parents 807440f + 40ec748 commit 544f339
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions wechat_sdk/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ def get_user_info(self, user_id, lang='zh_CN'):
return self.request.get(
url='https://api.weixin.qq.com/cgi-bin/user/info',
params={
'access_token': self.access_token,
'openid': user_id,
'lang': lang,
}
Expand All @@ -540,9 +539,7 @@ def get_followers(self, first_user_id=None):
:param first_user_id: 可选。第一个拉取的OPENID,不填默认从头开始拉取
:return: 返回的 JSON 数据包
"""
params = {
'access_token': self.access_token,
}
params = dict()
if first_user_id:
params['next_openid'] = first_user_id
return self.request.get('https://api.weixin.qq.com/cgi-bin/user/get', params=params)
Expand Down
4 changes: 2 additions & 2 deletions wechat_sdk/core/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ def grant_jsapi_ticket(self):
response_json = self.__request.get(
url="https://api.weixin.qq.com/cgi-bin/ticket/getticket",
params={
"access_token": self.access_token,
"type": "jsapi",
}
},
access_token=self.access_token,
)
self.__jsapi_ticket = response_json['ticket']
self.__jsapi_ticket_expires_at = int(time.time()) + response_json['expires_in']
Expand Down

0 comments on commit 544f339

Please sign in to comment.