示例#1
0
def delete_menu(account):
    token_rst = get_access_token(account)
    if token_rst.get("access_token", None):  # 获取到了tocken
        url = WXAPI.MENU_DELETE_GET + "?access_token=%s" % token_rst["access_token"]
        return json.loads(HttpClient.exeGet(url))
    else:  # 返回的是错误代码信息
        return token_rst
示例#2
0
def get_access_token(account):
    url = WXAPI.ACCESS_TOKEN_GET + "?grant_type=%s&appid=%s&secret=%s" % (
        account.granttype,
        account.appid,
        account.appsecret,
    )
    return json.loads(HttpClient.exeGet(url))
示例#3
0
def delete_menu(account):
    token_rst = get_access_token(account)
    if token_rst.get('access_token', None):  #获取到了tocken
        url = WXAPI.MENU_DELETE_GET + '?access_token=%s' % token_rst[
            'access_token']
        return json.loads(HttpClient.exeGet(url))
    else:  #返回的是错误代码信息
        return token_rst
示例#4
0
def get_access_token(account):
    url = WXAPI.ACCESS_TOKEN_GET + '?grant_type=%s&appid=%s&secret=%s' % (
        account.granttype, account.appid, account.appsecret)
    return json.loads(HttpClient.exeGet(url))