From 22775f979747e13b325bde2dbbbf62888240d9af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=B9=B8?= <2567198082@qq.com> Date: Tue, 14 Jun 2022 15:58:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20'app'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/user_service.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/app/user_service.py b/app/user_service.py index 139c140..4e485f1 100644 --- a/app/user_service.py +++ b/app/user_service.py @@ -22,6 +22,20 @@ path_prefix = '/var/www/wordfreq/wordfreq/' path_prefix = './' # comment this line in deployment + +#@userService.route("//reset", methods=['GET', 'POST']) +#def user_reset(username): + #''' + #用户界面 + #:param username: 用户名 + #:return: 返回页面内容 + #''' +# if request.method == 'GET': +# session['articleID'] = None +# return redirect(url_for('user_bp.userpage', username=username)) +# else: +# return 'Under construction' + @userService.route("//reset", methods=['GET', 'POST']) def user_reset(username): ''' @@ -29,12 +43,25 @@ def user_reset(username): :param username: 用户名 :return: 返回页面内容 ''' + session['temp'] = session.get('articleID') if request.method == 'GET': session['articleID'] = None return redirect(url_for('user_bp.userpage', username=username)) else: return 'Under construction' +@userService.route("//back", methods=['GET']) +def user_back(username): + ''' + 用户界面 + :param username: 用户名 + :return: 返回页面内容 + ''' + if request.method == 'GET': + session['articleID'] = session.get('temp') + return redirect(url_for('user_bp.userpage', username=username)) + + @userService.route("///unfamiliar", methods=['GET', 'POST']) def unfamiliar(username, word):