From 6be035f2828286b5cd59f15ec04336b86c3cb0fa 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: Tue, 25 Apr 2023 11:38:01 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93=E6=B2=A1=E6=9C=89?=
 =?UTF-8?q?=E6=89=BE=E5=88=B0=E6=96=87=E7=AB=A0=E6=88=96=E8=80=85=E6=96=87?=
 =?UTF-8?q?=E7=AB=A0=E8=AF=BB=E5=AE=8C=E6=97=B6=EF=BC=8C=E7=9B=B4=E6=8E=A5?=
 =?UTF-8?q?=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2=E6=88=96=E8=80=85session?=
 =?UTF-8?q?=E4=B8=8D=E5=85=B3=E9=97=AD=E9=87=8D=E6=96=B0=E8=BF=9B=E5=85=A5?=
 =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=AF=BC=E8=87=B4=E7=9A=84=E9=94=99?=
 =?UTF-8?q?=E8=AF=AF=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/Article.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/Article.py b/app/Article.py
index aac2c81..35a06a4 100644
--- a/app/Article.py
+++ b/app/Article.py
@@ -42,6 +42,9 @@ def get_today_article(user_word_list, had_read_articles):
     if had_read_articles["index"] > len(had_read_articles["article_ids"])-1:  # 生成新的文章,因此查找所有的文章
         rq.instructions("SELECT * FROM article")
     else:  # 生成阅读过的文章,因此查询指定 article_id 的文章
+        if had_read_articles["article_ids"][had_read_articles["index"]] == 'null':  # 可能因为直接刷新页面导致直接去查询了'null',因此当刷新的页面的时候,需要直接进行“上一篇”操作
+            had_read_articles["index"] -= 1
+            had_read_articles["article_ids"].pop()
         rq.instructions('SELECT * FROM article WHERE article_id=%d' % (had_read_articles["article_ids"][had_read_articles["index"]]))
     rq.do()
     result = rq.get_results()