Exemple #1
0
def get_menu(account):
    token_rst = get_access_token(account)
    if token_rst.get("access_token", None):  # 获取到了tocken
        url = WXAPI.MENU_GET_GET + "?access_token=%s" % token_rst["access_token"]
        return json.loads(HttpClient.exePost(url))
    else:
        return token_rst
Exemple #2
0
def get_menu(account):
    token_rst = get_access_token(account)
    if token_rst.get('access_token', None):  #获取到了tocken
        url = WXAPI.MENU_GET_GET + '?access_token=%s' % token_rst[
            'access_token']
        return json.loads(HttpClient.exePost(url))
    else:
        return token_rst
Exemple #3
0
def create_menu(account, data):
    token_rst = get_access_token(account)
    if token_rst.get("access_token", None):  # 获取到了tocken
        url = WXAPI.MENU_CREATE_POST + "?access_token=%s" % token_rst["access_token"]
        if isinstance(data, unicode):
            data = data.encode("UTF-8")
        rst_json = HttpClient.exePost(url, data)
        return json.loads(rst_json)
    else:  # 返回的是错误代码信息
        return token_rst
Exemple #4
0
def create_menu(account, data):
    token_rst = get_access_token(account)
    if token_rst.get('access_token', None):  #获取到了tocken
        url = WXAPI.MENU_CREATE_POST + '?access_token=%s' % token_rst[
            'access_token']
        if isinstance(data, unicode):
            data = data.encode('UTF-8')
        rst_json = HttpClient.exePost(url, data)
        return json.loads(rst_json)
    else:  #返回的是错误代码信息
        return token_rst