Ejemplo n.º 1
0
def register():
    """
    注册信息
    """
    username, pwd = common.input_username_pwd()
    flag, msg = admin_interface.register_interface(username, pwd)

    if flag:
        print(msg)
    else:
        print(msg)
Ejemplo n.º 2
0
def login():
    """
    登录
    """
    username, pwd = common.input_username_pwd()
    flag, msg = teacher_interface.login_interface(username, pwd)
    if flag:
        print(msg)
        teacher_info['user'] = username
    else:
        print(msg)
Ejemplo n.º 3
0
def login():
    """
    学生登录接口
    """
    username, pwd = common.input_username_pwd()
    flag, msg = student_interface.login_interface(username, pwd)

    if flag:
        print(msg)
        student_info['user'] = username
    else:
        print(msg)
Ejemplo n.º 4
0
def register():
    print('欢迎来到注册功能')
    count = 0
    while count < 3:
        username, pwd = common.input_username_pwd()

        flag, msg = user.register_interface(username, pwd)
        # 判断是否注册成功
        print(msg)
        if flag:
            logger.info(f'{username}注册成功')
            break
        count += 1
Ejemplo n.º 5
0
def login():
    print('欢迎来到登陆功能')
    global username

    count = 0
    while count < 3:
        login_username, pwd = common.input_username_pwd()

        flag, msg, level = user.login_interface(login_username, pwd)
        print(msg)
        if flag:
            user_auth['username'] = login_username
            username = login_username
            logger.info(f'{username}登录成功')
            break

        # 判断是否需要锁定
        if level in [2, 3]:
            user.locked_interface(login_username)
            print('你的账户已经被锁定了')
            break

        count += 1