Example #1
0
def register(username,password,email):
    '''验证用户是否存在 ,不存在就添加到数据库'''
    if User.is_exists(username):
        return {'msg':'username already exits'}

    hash_pass = hash_it(password)
    User.add_user(username,hash_pass,email)
    return {'msg':'ok'}
Example #2
0
def register(username, password, email):
    """
    把用户注册信息添加进数据库
    """
    if User.is_exists(username):
        return {'msg': 'username is exists'}

    hash_pass = hash_it(password)
    User.add_user(username, password=hash_pass, email=email)
    return {'msg': 'ok'}
Example #3
0
def register(username, password):
    """
    注册用户,增加用户信息到数据库
    :param username:
    :param password:
    :return:
    """
    if not User.is_exists(username):
        User.add_user(username, hashed(password))
        return {'msg': 'ok'}
    else:
        return {'msg': '用户名已存在,请重新注册. '}
def register(username, password):
    """
    注册
    :param username:
    :param password:
    :return:
    """
    if User.is_exists(username):
        return {'msg': username}
    hash_pass = hash_it(password)
    User.add(username, hash_pass)
    return {'msg': 'ok'}
Example #5
0
def register(username, password):
    if User.is_exists(username):
        return '已存在用户名'
    else:
        User.add_user(username, hashMD5(password))
        return 'ok'
Example #6
0
def register(username, password):
    if User.is_exists(username):
        return {'msg': 'username is exists'}
    hash_pass = hashed(password)
    User.add_user(username, hash_pass)
    return {'msg': 'ok'}
Example #7
0
def register(username, password, email):
    if User.is_exists(username):
        return {'msg': 'username exists'}
    hash_pass = hash_it(password)
    User.add_user(username, hash_pass, email)
    return {'msg': 'OK'}