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
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))
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
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))