Bug 542 - [NEW] 使用 JavaScript 的 localStorage 或 sessionStorage 来存储用户浏览过的文章
Summary: [NEW] 使用 JavaScript 的 localStorage 或 sessionStorage 来存储用户浏览过的文章
Status: CONFIRMED
Alias: None
Product: EnglishPal
Classification: Unclassified
Component: 改进建议 (show other bugs)
Version: 0.1
Hardware: PC Windows
: Normal enhancement
Deadline: 2023-12-31
Assignee: Hui Lan
URL:
Depends on:
Blocks:
 
Reported: 2023-08-12 15:51 CST by Hui Lan
Modified: 2023-08-12 15:52 CST (History)
0 users

See Also:


Attachments

Description Hui Lan 2023-08-12 15:51:28 CST
目前使用的是 Flask 的 session 对象。 

感觉编程起来比较复杂。

而且,在更新程序后,原来的 session 会丢失,导致点击“下一篇文章”按钮时,会报错。


  File "./EnglishPal/app/templates/userpage_get.html", line 73, in top-level template code
    <div class="alert alert-success" role="alert">According to your word list, your level is <span class="text-decoration-underline" id="user_level">{{ '%0.1f' % today_article["user_level"] }}</span>  and we have chosen an article with a difficulty level of <span class="text-decoration-underline" id="text_level">{{ today_article["text_level"] }}</span> for you.</div>
TypeError: must be real number, not str

Hui

Note You need to log in before you can comment on or make changes to this bug.