Exemple #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', [])
Exemple #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']
Exemple #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']
Exemple #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', [])
Exemple #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)
Exemple #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))
Exemple #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))
Exemple #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))
Exemple #9
0
def get_user_vote(openid):
    return http_get('http://166.111.80.30/acquireid?openid='+openid)
Exemple #10
0
def get_user_vote(openid):
    return http_get('http://166.111.80.30/acquireid?openid=' + openid)