From f14e774b3b8ade84d157aa9585203e67694ccea2 Mon Sep 17 00:00:00 2001 From: shinya Date: Mon, 14 Jul 2025 12:57:16 +0800 Subject: [PATCH] feat: disable d1 change config --- src/app/admin/page.tsx | 80 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 10 deletions(-) diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index bc9859f..8e4f490 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -126,6 +126,11 @@ const UserConfig = ({ config, role, refreshConfig }: UserConfigProps) => { // 当前登录用户名 const currentUsername = getAuthInfoFromBrowserCookie()?.username || null; + // 检测存储类型是否为 d1 + const isD1Storage = + typeof window !== 'undefined' && + (window as any).RUNTIME_CONFIG?.STORAGE_TYPE === 'd1'; + useEffect(() => { if (config?.UserConfig) { setUserSettings({ @@ -285,18 +290,29 @@ const UserConfig = ({ config, role, refreshConfig }: UserConfigProps) => { 注册设置
-