def userinfo(QQ, name, password): pool_flag = session.get(POOL_FLAG) conn = get_redis_conn(pool_flag) if check_password(conn, QQ, password): user = UserInfo(QQ) user.load() result = dict(finish=1, user=user.to_dict()) return json.dumps(result, ensure_ascii=False) else: result = dict(finish=0) return json.dumps(result, ensure_ascii=False)
def userinfo(QQ, name, password): pool = get_pool() conn = redis.Redis(connection_pool=pool) if check_password(conn, QQ, password): user = UserInfo() user.load(QQ) result = dict(finish=1, user=user.to_dict()) return json.dumps(result, ensure_ascii=False) else: result = dict(finish=0) return json.dumps(result, ensure_ascii=False)
def userinfo(QQ, name, password): pool_flag = session.get(POOL_FLAG) # 当前后端域名:端口不一致时,cookie无法跨站传输,导致session为空,故需要再判断一次 if not pool_flag: host = judge_pool() conn = get_redis_conn(host) else: conn = get_redis_conn(pool_flag) if check_password(conn, QQ, password): user = UserInfo(QQ) result = user.load_from_redis(QQ) if result != None: result = dict(finish=1, user=user.to_dict()) return json.dumps(result, ensure_ascii=False) else: result = dict(finish=0) return json.dumps(result, ensure_ascii=False) else: result = dict(finish=0) return json.dumps(result, ensure_ascii=False)