def grant_jsapi_ticket(self):
        """
        获取 jsapi ticket 并更新当前配置
        :return: 返回的 JSON 数据包 (传入 jsapi_ticket_refreshfunc 参数后返回 None)
        """
        self._check_appid_appsecret()

        if callable(self.__jsapi_ticket_refreshfunc):
            self.__jsapi_ticket, self.__jsapi_ticket_expires_at = self.__jsapi_ticket_refreshfunc()
            return

        response_json = self.__request.get(
            url="https://api.weixin.qq.com/cgi-bin/ticket/getticket",
            params={
                "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']

        if callable(self.__jsapi_ticket_setfunc):
            self.__jsapi_ticket_setfunc(self.__jsapi_ticket, self.__jsapi_ticket_expires_at)

        return response_json
def grant_jsapi_ticket(self):
        """
        获取 jsapi ticket 并更新当前配置
        :return: 返回的 JSON 数据包 (传入 jsapi_ticket_refreshfunc 参数后返回 None)
        """
        self._check_appid_appsecret()

        if callable(self.__jsapi_ticket_refreshfunc):
            self.__jsapi_ticket, self.__jsapi_ticket_expires_at = self.__jsapi_ticket_refreshfunc()
            return

        response_json = self.__request.get(
            url="https://api.weixin.qq.com/cgi-bin/ticket/getticket",
            params={
                "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']

        if callable(self.__jsapi_ticket_setfunc):
            self.__jsapi_ticket_setfunc(self.__jsapi_ticket, self.__jsapi_ticket_expires_at)

        return response_json
def grant_jsapi_ticket ( self ) : self . _check_appid_appsecret ( ) if callable ( self . __jsapi_ticket_refreshfunc ) : self . __jsapi_ticket , self . __jsapi_ticket_expires_at = self . __jsapi_ticket_refreshfunc ( ) return response_json = self . __request . get ( url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket" , params = { "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' ] if callable ( self . __jsapi_ticket_setfunc ) : self . __jsapi_ticket_setfunc ( self . __jsapi_ticket , self . __jsapi_ticket_expires_at ) return response_json
获取 jsapi ticket 并更新当前配置
        :return: 返回的 JSON 数据包 (传入 jsapi_ticket_refreshfunc 参数后返回 None)
获取 jsapi ticket 并更新当前配置 : return : 返回的 JSON 数据包 ( 传入 jsapi_ticket_refreshfunc 参数后返回 None )