From 5217e19b25b7a345af5a5252abe164b1948dd490 Mon Sep 17 00:00:00 2001 From: kkfluous Date: Wed, 29 Apr 2026 19:04:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(ele):=20/ele/import=20=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20hash=20=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主应用模块切换走 hash(#mileage 等),用户也会用 #/ele/import 访问。 之前只判 pathname='/ele/import',hash 形式直接落到 Shell 默认模块。 现在 path / hash 两种形式(/ele/import、#/ele/import、#ele/import)都识别。 Co-Authored-By: Claude Opus 4.7 (1M context) --- src/App.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index dd20f2b..5e3ee81 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -46,9 +46,13 @@ function AuthGate() { return ; } - // 隐藏后端管理页:仅通过 /ele/import 直接访问,主导航不出现 - if (typeof window !== 'undefined' && window.location.pathname === '/ele/import') { - return ; + // 隐藏后端管理页:通过 /ele/import 或 #/ele/import 直接访问,主导航不出现 + if (typeof window !== 'undefined') { + const path = window.location.pathname; + const hash = window.location.hash; + if (path === '/ele/import' || hash === '#/ele/import' || hash === '#ele/import') { + return ; + } } return ;