Exemplo n.º 1
0
def get_custom_menu():
    return False;
    access_token = get_access_token()
    url = WEIXIN_URLS['get_custom_menu'](access_token)
    res = http_get(url)
    rjson = json.loads(res)
    return rjson.get('menu', {}).get('button', [])
Exemplo n.º 2
0
def get_access_token():
    url = WEIXIN_URLS['access_token']()
    res = http_get(url)
    rjson = json.loads(res)
    if 'errorcode' in rjson:
        raise res
    return rjson['access_token']
Exemplo n.º 3
0
def get_access_token():
    url = WEIXIN_URLS['access_token']()
    res = http_get(url)
    rjson = json.loads(res)
    if 'errorcode' in rjson:
        raise res
    return rjson['access_token']
Exemplo n.º 4
0
def get_custom_menu():
    return False
    access_token = get_access_token()
    url = WEIXIN_URLS['get_custom_menu'](access_token)
    res = http_get(url)
    rjson = json.loads(res)
    return rjson.get('menu', {}).get('button', [])
Exemplo n.º 5
0
def wechat_wall(request):
    code = request.GET.get('code')
    url = WEIXIN_URLS['get_openid'](code)
    res = http_get(url)
    rtn_json = json.loads(res)
    openid = rtn_json['openid']
    return redirect('http://wx1.igeek.asia/u/loading/' + openid)
Exemplo n.º 6
0
def loading(request):
    code = request.GET.get('code')
    url = WEIXIN_URLS['get_openid'](code)
    res = http_get(url)
    rtn_json = json.loads(res)
    openid = rtn_json['openid']
    if select_users_by_openid(openid).exists():
        return redirect(s_reverse_wall(openid))
    else:
        return redirect(s_reverse_login(openid))
Exemplo n.º 7
0
def loading(request):
    code = request.GET.get('code')
    url = WEIXIN_URLS['get_openid'](code)
    res = http_get(url)
    rtn_json = json.loads(res)
    openid = rtn_json['openid']
    if select_users_by_openid(openid).exists():
        return redirect(s_reverse_wall(openid))
    else:
        return redirect(s_reverse_login(openid))
Exemplo n.º 8
0
def uc_center(request):
    code = request.GET.get('code')
    url = WEIXIN_URLS['get_openid'](code)
    res = http_get(url)
    rtn_json = json.loads(res)
    openid = rtn_json['openid']
    if select_users_by_openid(openid).exists():
        return redirect(s_reverse_uc_ticket(openid))
    else:
        return redirect(s_reverse_uc_account(openid))
Exemplo n.º 9
0
def get_user_vote(openid):
    return http_get('http://166.111.80.30/acquireid?openid='+openid)
Exemplo n.º 10
0
def get_user_vote(openid):
    return http_get('http://166.111.80.30/acquireid?openid=' + openid)