From 74dc91d59e9ead8d9acc705bee00b2fa2d09e39c Mon Sep 17 00:00:00 2001 From: mtvpls Date: Sat, 31 Jan 2026 00:50:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=9D=A2=E6=9D=BF=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/admin/page.tsx | 46 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index d64ef31..54da021 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -11290,8 +11290,12 @@ function AdminPageClient() { setRole(data.Role); } catch (err) { const msg = err instanceof Error ? err.message : '获取配置失败'; - showError(msg, showAlert); - setError(msg); + // 只在首次加载时设置错误状态,避免弹窗和错误页面同时显示 + if (showLoading) { + setError(msg); + } else { + showError(msg, showAlert); + } } finally { if (showLoading) { setLoading(false); @@ -11424,8 +11428,42 @@ function AdminPageClient() { } if (error) { - // 错误已通过弹窗展示,此处直接返回空 - return null; + // 显示无权限提示页面 + return ( + +
+
+
+
+
+ +
+
+

+ 无权限访问 +

+

+ {error} +

+
+ + +
+
+
+
+
+ ); } return (