diff --git a/app/auth/views.py b/app/auth/views.py index ccbd3bc..1fec47f 100644 --- a/app/auth/views.py +++ b/app/auth/views.py @@ -25,7 +25,7 @@ def before_request(): return redirect(url_for('auth.unconfirmed')) -@auth.route('/logintest', methods=['GET', 'POST']) +@auth.route('/login', methods=['GET', 'POST']) def logintest(): if request.method == 'GET': return render_template('auth/login-and-register.html') @@ -48,28 +48,28 @@ def logintest(): return render_template('auth/login.html') -# 登录 -@auth.route('/login', methods=['GET', 'POST']) -def login(): - if request.method == 'GET': - return render_template('auth/login.html') - if request.method == 'POST': - student_id = request.form["user"] - password = request.form["pwd"] - user = User.query.filter_by(student_id=student_id).first() - if user is None: - flash("Your StudentID/OrganizationID has not been registered") - return render_template('auth/login.html') - elif user.verify_password(password) is False: - flash("StudentID/OrganizationID or password error") - return render_template('auth/login.html') - if user is not None and user.verify_password(password): - login_user(user, True) - next = request.args.get('next') - if next is None or not next.startswith('/'): - next = url_for('main.index') - return redirect(next) - return render_template('auth/login.html') +# # 登录 +# @auth.route('/login', methods=['GET', 'POST']) +# def login(): +# if request.method == 'GET': +# return render_template('auth/login.html') +# if request.method == 'POST': +# student_id = request.form["user"] +# password = request.form["pwd"] +# user = User.query.filter_by(student_id=student_id).first() +# if user is None: +# flash("Your StudentID/OrganizationID has not been registered") +# return render_template('auth/login.html') +# elif user.verify_password(password) is False: +# flash("StudentID/OrganizationID or password error") +# return render_template('auth/login.html') +# if user is not None and user.verify_password(password): +# login_user(user, True) +# next = request.args.get('next') +# if next is None or not next.startswith('/'): +# next = url_for('main.index') +# return redirect(next) +# return render_template('auth/login.html') # 相册 diff --git a/data-dev.sqlite b/data-dev.sqlite index 9793764..87502db 100644 Binary files a/data-dev.sqlite and b/data-dev.sqlite differ