forked from mrlan/EnglishPal
修复Bug-490
parent
1ddab74f04
commit
270f6159b2
|
@ -32,16 +32,17 @@ def signup():
|
||||||
return str(warn)
|
return str(warn)
|
||||||
|
|
||||||
available = check_username_availability(username)
|
available = check_username_availability(username)
|
||||||
|
verified_2 = verify_passverified(password, password2)
|
||||||
if not available: # 用户名不可用
|
if not available: # 用户名不可用
|
||||||
flash('用户名 %s 已经被注册。' % (username))
|
flash('用户名 %s 已经被注册。' % (username))
|
||||||
return render_template('signup.html')
|
return render_template('signup.html')
|
||||||
elif len(password.strip()) < 4: # 密码过短
|
elif len(password.strip()) < 4: # 密码过短
|
||||||
return '密码过于简单。'
|
return '密码过于简单。'
|
||||||
|
elif not verified_2:
|
||||||
|
return '确认密码与输入密码不一致!'
|
||||||
else: # 添加账户信息
|
else: # 添加账户信息
|
||||||
add_user(username, password)
|
add_user(username, password)
|
||||||
verified = verify_user(username, password)
|
verified = verify_user(username, password)
|
||||||
verified_2 = verify_passverified(password, password2)
|
|
||||||
if verified_2: # 确认密码与输入密码一致后
|
|
||||||
if verified:
|
if verified:
|
||||||
# 写入session
|
# 写入session
|
||||||
session['logged_in'] = True
|
session['logged_in'] = True
|
||||||
|
@ -53,8 +54,7 @@ def signup():
|
||||||
<p><a href="/%s">开始使用</a> <a href="/">返回首页</a><p/>' % (username, username, username)
|
<p><a href="/%s">开始使用</a> <a href="/">返回首页</a><p/>' % (username, username, username)
|
||||||
else:
|
else:
|
||||||
return '用户名密码验证失败。'
|
return '用户名密码验证失败。'
|
||||||
else:
|
|
||||||
return '确认密码与输入密码不一致!'
|
|
||||||
|
|
||||||
|
|
||||||
@accountService.route("/login", methods=['GET', 'POST'])
|
@accountService.route("/login", methods=['GET', 'POST'])
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
Flask==1.1.2
|
Flask==2.1.0
|
||||||
selenium==3.141.0
|
selenium==3.141.0
|
||||||
PyYAML~=6.0
|
PyYAML~=6.0
|
||||||
|
|
Loading…
Reference in New Issue