wechat_sdk/core/conf.py
def jsapi_ticket(self):
        """ 获取当前 jsapi ticket 值, 本方法会自行维护 jsapi ticket 有效性 """
        self._check_appid_appsecret()

        if callable(self.__jsapi_ticket_getfunc):
            self.__jsapi_ticket, self.__jsapi_ticket_expires_at = self.__jsapi_ticket_getfunc()

        if self.__jsapi_ticket:
            now = time.time()
            if self.__jsapi_ticket_expires_at - now > 60:
                return self.__jsapi_ticket

        self.grant_jsapi_ticket()  # 从腾讯服务器获取 jsapi ticket 并更新
        return self.__jsapi_ticket
def jsapi_ticket(self):
        """ 获取当前 jsapi ticket 值, 本方法会自行维护 jsapi ticket 有效性 """
        self._check_appid_appsecret()

        if callable(self.__jsapi_ticket_getfunc):
            self.__jsapi_ticket, self.__jsapi_ticket_expires_at = self.__jsapi_ticket_getfunc()

        if self.__jsapi_ticket:
            now = time.time()
            if self.__jsapi_ticket_expires_at - now > 60:
                return self.__jsapi_ticket

        self.grant_jsapi_ticket()  # 从腾讯服务器获取 jsapi ticket 并更新
        return self.__jsapi_ticket
def jsapi_ticket ( self ) : self . _check_appid_appsecret ( ) if callable ( self . __jsapi_ticket_getfunc ) : self . __jsapi_ticket , self . __jsapi_ticket_expires_at = self . __jsapi_ticket_getfunc ( ) if self . __jsapi_ticket : now = time . time ( ) if self . __jsapi_ticket_expires_at - now > 60 : return self . __jsapi_ticket self . grant_jsapi_ticket ( ) # 从腾讯服务器获取 jsapi ticket 并更新 return self . __jsapi_ticket
获取当前 jsapi ticket 值, 本方法会自行维护 jsapi ticket 有效性
获取当前 jsapi ticket 值 本方法会自行维护 jsapi ticket 有效性