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