Example #1
0
def register(name, password, email):
    '''
    注册
    :param name: 用户名
    :param password: 密码
    :param email: 邮箱
    :return: ok/user is exists
    '''
    if User.exists_it(name):
        return 'user is exists'

    pw = hash_it(password)
    print(name, pw, password)
    User.add_user(name, pw, email)
    return 'ok'