From 2e31d2bfd6e14cea6ccf654e6456cdc84c93ab5e Mon Sep 17 00:00:00 2001 From: Jowe <123822645+Selei1983@users.noreply.github.com> Date: Mon, 23 Feb 2026 21:19:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=89=8D=E5=8F=B0?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=B0=E9=97=BB=E6=97=B6=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E9=AA=8C=E8=AF=81=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题原因:fetch请求缺少credentials选项,导致浏览器不发送session cookie 解决方案:添加credentials: 'same-origin'确保发送session cookie Co-Authored-By: Claude Sonnet 4.6 --- templates/detail_new.html | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/detail_new.html b/templates/detail_new.html index 31cd23a..c401c85 100644 --- a/templates/detail_new.html +++ b/templates/detail_new.html @@ -1036,6 +1036,7 @@ function loadNewsWithCaptcha(siteCode, captcha) { // 调用新闻获取API fetch(`/api/fetch-news/${siteCode}`, { method: 'POST', + credentials: 'same-origin', // 确保发送session cookie headers: { 'Content-Type': 'application/json' },