def grant_jsapi_ticket(self):
self._check_appid_appsecret()<EOL>if callable(self.__jsapi_ticket_refreshfunc):<EOL><INDENT>self.__jsapi_ticket, self.__jsapi_ticket_expires_at = self.__jsapi_ticket_refreshfunc()<EOL>return<EOL><DEDENT>response_json = self.__request.get(<EOL>url="<STR_LIT>",<EOL>params={<EOL>"<STR_LIT:type>": "<STR_LIT>",<EOL>},<EOL>access_token=self.access_token,<EOL>)<EOL>self.__jsapi_ticket = response_json['<STR_LIT>']<EOL>self.__jsapi_ticket_expires_at = int(time.time()) + response_json['<STR_LIT>']<EOL>if callable(self.__jsapi_ticket_setfunc):<EOL><INDENT>self.__jsapi_ticket_setfunc(self.__jsapi_ticket, self.__jsapi_ticket_expires_at)<EOL><DEDENT>return response_json<EOL>
获取 jsapi ticket 并更新当前配置
:return: 返回的 JSON 数据包 (传入 jsapi_ticket_refreshfunc 参数后返回 None)