From bda3421482d3994ef53ca365456a870db2eb66e0 Mon Sep 17 00:00:00 2001 From: bug_creator Date: Wed, 1 Dec 2021 14:01:50 +0800 Subject: [PATCH] login --- app/auth/views.py | 46 +++++++++++++++++++++++----------------------- data-dev.sqlite | Bin 6885376 -> 6885376 bytes 2 files changed, 23 insertions(+), 23 deletions(-) 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 97937645f3e9400fd3a136b50b238b725feb9896..87502db27ad9658499260c548e71206aa8b37da0 100644 GIT binary patch delta 460 zcmWm8$1)=T007WQ^s;(cy>}uBg6O^X-h;(n_8&MHS34O;Gke%yF#g7$nDHFm{oVij zpK{N0Rp8}s^-SR9A@P_9yd{F4;k;Np9F9kaLc;@t(MT*g`P%-Jj08y`l{C`HAd@Vz z$sv~?5^4sHKj28fc`6W?E>ajqh6ropjMn4a5v%)HCth2!;TWqt#E_>{Az#&H*bHXWS XoO3~fORl))7dPB;_nwUW{`2t#G4873 delta 458 zcmWm8$ugS(007{Lt+uG8C<(Pwwd6;FAeLBLYm3?iwOqUd2h(d!&So6Eg7G%q#Eh?p z@BZC9KIPu4{eQ$sDEsiU3