From 84affaeb69fdecb155cdf4daa4f57c4b29dbea55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E9=97=AE=E4=B8=89=E4=B8=8D=E7=9F=A5?= <178428409@qq.com> Date: Thu, 20 Apr 2023 20:30:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20/=20=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E5=AD=98=E5=9C=A8=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=88?= =?UTF-8?q?=E6=AF=8F=E6=AC=A1=E8=B0=83=E7=94=A8=E5=88=AB=E7=9A=84=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E4=BB=96=E9=83=BD=E4=BC=9A=E8=A2=AB=E8=B0=83=E7=94=A8?= =?UTF-8?q?=EF=BC=89=EF=BC=8C=E6=96=B0=E8=B7=AF=E7=94=B1=E4=B8=BA=20//userpage;=E5=90=8C=E6=97=B6=E5=9B=A0=E4=B8=BA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BA=86=E8=B7=AF=E7=94=B1=E5=AF=BC=E8=87=B4=E8=AE=BF?= =?UTF-8?q?=E9=97=AEuserpage=5Fget=E7=9A=84=E6=97=B6=E5=80=99=E4=BC=9A?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E9=9D=99=E6=80=81=E6=96=87=E4=BB=B6=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E7=94=9F=E6=88=90=E9=94=99=E8=AF=AF=EF=BC=8C=E8=BF=99?= =?UTF-8?q?=E9=87=8C=E4=BF=AE=E6=94=B9=E4=BA=86\static\config.yml=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E9=9D=99=E6=80=81=E8=B5=84=E6=BA=90=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=90=8E=E4=B9=9F=E9=83=BD=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=AD=A3=E5=B8=B8=E8=AE=BF=E9=97=AE=E5=88=B0=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/config.yml | 10 +++++----- app/templates/login.html | 2 +- app/templates/reset.html | 2 +- app/templates/signup.html | 2 +- app/templates/userpage_get.html | 2 +- app/user_service.py | 3 ++- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/static/config.yml b/app/static/config.yml index 20aa396..e6f7ef1 100644 --- a/app/static/config.yml +++ b/app/static/config.yml @@ -1,16 +1,16 @@ # 全局引入的css文件地址 css: item: - - static/css/bootstrap.css + - ../static/css/bootstrap.css # 全局引入的js文件地址 js: head: # 在页面加载之前加载 - - static/js/jquery.js - - static/js/word_operation.js + - ../static/js/jquery.js + - ../static/js/word_operation.js bottom: # 在页面加载完之后加载 - - static/js/fillword.js - - static/js/highlight.js + - ../static/js/fillword.js + - ../static/js/highlight.js # 高亮样式,目前仅支持修改颜色 highlight: diff --git a/app/templates/login.html b/app/templates/login.html index ccf6f34..2507f75 100644 --- a/app/templates/login.html +++ b/app/templates/login.html @@ -22,7 +22,7 @@ alert('无法通过验证。'); window.location.href = "/login"; } else if (response.status === '1') { - window.location.href = "/"+username; + window.location.href = "/"+username+"/userpage"; } } ) diff --git a/app/templates/reset.html b/app/templates/reset.html index d29855b..3425c97 100644 --- a/app/templates/reset.html +++ b/app/templates/reset.html @@ -45,7 +45,7 @@ - + {% endblock %} \ No newline at end of file diff --git a/app/templates/signup.html b/app/templates/signup.html index c70e4ba..9030d41 100644 --- a/app/templates/signup.html +++ b/app/templates/signup.html @@ -35,7 +35,7 @@ You're logged in already! Logout. } else if (response.status === '2') { let f = confirm("恭喜,你已成功注册,你的用户名是"+username+'.\n点击“确认”开始使用,或点击“取消”返回首页'); if (f) { - window.location.href = '/'+username; + window.location.href = '/'+username+'/userpage'; } else { window.location.href = '/'; } diff --git a/app/templates/userpage_get.html b/app/templates/userpage_get.html index 428bb3b..8936ff7 100644 --- a/app/templates/userpage_get.html +++ b/app/templates/userpage_get.html @@ -90,7 +90,7 @@

收集生词吧 (可以在正文中划词,也可以复制黏贴)

-
+
diff --git a/app/user_service.py b/app/user_service.py index 61b129d..b9f8d26 100644 --- a/app/user_service.py +++ b/app/user_service.py @@ -97,7 +97,7 @@ def deleteword(username, word): return "success" -@userService.route("/", methods=['GET', 'POST']) +@userService.route("//userpage", methods=['GET', 'POST']) def userpage(username): ''' 用户界面 @@ -105,6 +105,7 @@ def userpage(username): :return: 返回用户界面 ''' # 未登录,跳转到未登录界面 + print("123123") if not session.get('logged_in'): return render_template('not_login.html')