def grant_access_token(self):
self._check_appid_appsecret()<EOL>if callable(self.__access_token_refreshfunc):<EOL><INDENT>self.__access_token, self.__access_token_expires_at = self.__access_token_refreshfunc()<EOL>return<EOL><DEDENT>response_json = self.__request.get(<EOL>url="<STR_LIT>",<EOL>params={<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": self.__appid,<EOL>"<STR_LIT>": self.__appsecret,<EOL>},<EOL>access_token=self.__access_token<EOL>)<EOL>self.__access_token = response_json['<STR_LIT>']<EOL>self.__access_token_expires_at = int(time.time()) + response_json['<STR_LIT>']<EOL>if callable(self.__access_token_setfunc):<EOL><INDENT>self.__access_token_setfunc(self.__access_token, self.__access_token_expires_at)<EOL><DEDENT>return response_json<EOL>
获取 access token 并更新当前配置
:return: 返回的 JSON 数据包 (传入 access_token_refreshfunc 参数后返回 None)