def register(): print('\033[32m注册\033[0m') if USER['name']: print('\033[31m已登陆,不能注册!\033[0m') while 1: name = input('请输入注册用户名 >>: ').strip() if name == 'q': break password = input('请输入注册密码 >>: ').strip() password2 = input('请输入注册密码 >>: ').strip() if password != password2: print('\033[31m两次输入密码不一致!\033[0m') continue flag, msg = admin_api.register(name, password) print(msg) if flag: return
def register(): print('\033[32m注册\033[0m') while True: name = input('请输入注册用户名 >>: ').strip() if name == 'q': break password = input('请输入注册密码 >>: ').strip() password2 = input('请输入注册密码 >>: ').strip() if password != password2: print('\033[31m两次密码输入不一致!\033[0m') continue flag, msg = admin_api.register(name, password) if flag: print('\033[32m%s\033[0m' % msg) return else: print('\033[31m%s\033[0m' % msg)
def register(): print('\033[32m注册\033[0m') if USER['name']: print('\033[32m已登陆,不能注册!\033[0m') while True: name = input('请输入注册用户名 >>: ').strip() pwd = input('请输入注册密码 >>: ').strip() pwd2 = input('请确认注册密码 >>: ').strip() if pwd != pwd2: print('\033[31m两次密码输入不一致!\033[0m') continue flag, msg = admin_api.register(name, pwd) if flag: print(msg) return else: print(msg)
def register(): print('\033[32m注册\033[0m') while True: name = common.input_string('注册用户名') if name == 'q': break password = common.input_string('注册密码') if password == 'q': break password2 = common.input_string('确认密码') if password2 == 'q': break if password != password2: print('\033[31m两次输入密码不一致!\033[0m') continue flag, msg = admin_api.register(name, password) if flag: print('\033[32m%s\033[0m' % msg) return else: print('\033[31m%s\033[0m' % msg)
def register(): common.show_green('注册') if CURRENT_USER: common.show_red('已登录,不能注册!') return while True: name = common.input_string('注册用户名') if name == 'q': break password = common.input_string('注册密码') if password == 'q': break password2 = common.input_string('确认密码') if password2 == 'q': break if password != password2: common.show_red('两次密码出入不一致!') continue flag, msg = admin_api.register(name, password) if not flag: common.show_red(msg) continue common.show_green(msg) return