获取 access token 详情请参考 http://mp.weixin.qq.com/wiki/index.php?title=通用接口文档 :return: 返回的 JSON 数据包
(self)
| 51 | self.secret = secret |
| 52 | |
| 53 | def fetch_access_token(self): |
| 54 | """ |
| 55 | 获取 access token |
| 56 | 详情请参考 http://mp.weixin.qq.com/wiki/index.php?title=通用接口文档 |
| 57 | |
| 58 | :return: 返回的 JSON 数据包 |
| 59 | """ |
| 60 | return self._fetch_access_token( |
| 61 | url='https://api.weixin.qq.com/cgi-bin/token', |
| 62 | params={ |
| 63 | 'grant_type': 'client_credential', |
| 64 | 'appid': self.appid, |
| 65 | 'secret': self.secret |
| 66 | } |
| 67 | ) |
| 68 | |
| 69 | |
| 70 | class WeChatComponentClient(WeChatClient): |