From 63cb897f8cc82774b721e4c3acb96dd856a36b6d Mon Sep 17 00:00:00 2001 From: bwstudio Date: Wed, 9 Sep 2026 21:54:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(cookieManager):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=96=B0=E5=A2=9E/=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BF=9D=E5=AD=98=E6=97=A0=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原因1:cookie 四个页面(add/edit x user/site)缺少 {% include 'system/common/footer.html' %}, 导致 layui.js/pear.js 未加载,layui.use 报错,提交按钮的 submit 事件从未绑定。 原因2:expiry 字段为空字符串时直接写入 DateTime 列,SQLite 抛 TypeError(SQLite DateTime type only accepts Python datetime and date objects)。 新增 _parse_expiry 辅助函数:空值转 None,非空按格式解析为 datetime。 已用 Playwright 真机验证:新增/编辑均返回 200 且数据落库。 --- .../templates/system/cookie_site/add.html | 1 + .../templates/system/cookie_site/edit.html | 1 + .../templates/system/cookie_user/add.html | 1 + .../templates/system/cookie_user/edit.html | 1 + plugins/cookieManager/view/cookie_site.py | 18 ++++++++++++++++-- plugins/cookieManager/view/cookie_user.py | 18 ++++++++++++++++-- 6 files changed, 36 insertions(+), 4 deletions(-) diff --git a/plugins/cookieManager/templates/system/cookie_site/add.html b/plugins/cookieManager/templates/system/cookie_site/add.html index 720e781..7a7f8ea 100644 --- a/plugins/cookieManager/templates/system/cookie_site/add.html +++ b/plugins/cookieManager/templates/system/cookie_site/add.html @@ -77,6 +77,7 @@ +{% include 'system/common/footer.html' %}