def post(self, *args, **kwargs): username = self.get_body_argument('username',None) password = self.get_body_argument('password',None) confirmpassword = self.get_body_argument('confirmpassword',None) # email = self.get_body_argument('email',None) print('***********') if username and password and (password == confirmpassword): ret = register(username,password) print(username,password,confirmpassword,ret) self.session.set('ID',username) self.redirect('/index') else: self.write({'msg':'register fail'})
def post(self, *args, **kwargs): username = self.get_argument('username', None) password1 = self.get_argument('password1', None) password2 = self.get_argument('password2', None) if username and password1 and (password1 == password2): ret = register(username, password1) if ret['msg'] == 'ok': self.session.set('tudo_user', username) self.redirect('/') else: self.write(ret) else: self.write({'msg': 'signup_fail'})
def post(self, *args, **kwargs): username = self.get_argument('username', '') password1 = self.get_argument('password1', '') password2 = self.get_argument('password2', '') if username and password1 and password2: if password1 != password2: self.write({'msg': '两次输入的密码不匹配!'}) else: ret = register(username, password1) if ret['msg'] == 'ok': self.session.set('tudo_user_info', username) self.redirect('/') else: self.write(ret) else: self.render('signup.html', msg={'register fail'})
def post(self, *args, **kwargs): username = self.get_argument('username', None) #获取注册信息 password1 = self.get_argument('password1', None) password2 = self.get_argument('password2', None) email = self.get_argument('email', None) if username and password1 and password2: if password1 != password2: self.write('两次密码不同') else: ret = register(username, password1, email) #进行注册 if ret == 'ok': #如果注册返回值为‘ok’ self.session.set('user_info', username) #进行登入以及跳转 self.redirect('/') else: #注册失败打印注册返回值 self.write(ret) else: #username,password1,password2任一个为空,重新跳转注册界面 self.render('/signup.html', msg='register fail')
def post(self, *args, **kwargs): username = self.get_argument('username', '') email = self.get_argument('email', '') password1 = self.get_argument('password1', '') password2 = self.get_argument('password2', '') if username and password1 and password2: if password1 != password2: # self.write({'msg':'两次输入的密码不匹配'}.decode()) self.write('两次输入的密码不匹配') else: ret = register(username, password1, email) if ret['msg'] == 'OK': self.session.set('bayern_user_info', username) self.redirect('/') else: self.write(ret) else: self.render('signup.html', msg={'register': 'fail'})
def post(self): username = self.get_argument('username', '') email = self.get_argument('email', '') password1 = self.get_argument('password1', '') password2 = self.get_argument('password2', '') if username and password1 and password2: if password1 != password2: self.write('两次输入的密码不匹配') else: '''注册成功,直接跳转首页''' ret = register(username=username, password=password1, email=email) if ret['msg'] == 'ok': self.session.set('tornado_user_info', username) self.redirect('/') else: self.write(ret) else: self.render('register.html', msg={'register fail'})
def post(self): username = self.get_argument('username', '') email = self.get_argument('email', '') password1 = self.get_argument('password1', '') password2 = self.get_argument('password2', '') print(username, password1, email, password2) if username and password1 and password2: if password1 != password2: self.write('两次输入的密码不匹配!!!') else: ret = register(username, password1, email) if ret['msg'] == 'ok': self.session.set('tudo_user_info', username) self.redirect('/') else: self.write(ret) else: self.render('signup.html', msg={'register fail'})
def post(self, *args, **kwargs): name = self.get_argument('username', None) password1 = self.get_argument('password1', None) password2 = self.get_argument('password2', None) msg = '' if name and password1 and password2: if password1 == password2: ret = register(name, password1) if ret['msg'] == 'ok': #如果注册成功,跳转到首页. self.session.set('simon_user_info', name) self.redirect('/') else: msg = ret['msg'] else: msg = 'password 不同,请重新输入.' else: msg = '帐号或者密码不能为空.' self.render('signup.html', msg=msg)