From ad8427208437777b454187b14bbceeabc24d13a8 Mon Sep 17 00:00:00 2001 From: fawney19 Date: Sat, 10 Jan 2026 19:31:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=97=A0=E6=B3=95=E8=AE=BF=E9=97=AE=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E7=9B=98=E6=8E=A5=E5=8F=A3=E7=9A=84=E6=9D=83=E9=99=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 DashboardAdapter 的 mode 从 ApiMode.ADMIN 改为 ApiMode.USER, 允许普通用户访问 /api/dashboard/stats 和 /api/dashboard/daily-stats 接口。 --- src/api/dashboard/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/dashboard/routes.py b/src/api/dashboard/routes.py index a4e5b8a..2613335 100644 --- a/src/api/dashboard/routes.py +++ b/src/api/dashboard/routes.py @@ -155,7 +155,7 @@ async def get_daily_stats( class DashboardAdapter(ApiAdapter): """需要登录的仪表盘适配器基类。""" - mode = ApiMode.ADMIN + mode = ApiMode.USER # 普通用户也可访问仪表盘 def authorize(self, context): # type: ignore[override] if not context.user: