fix(ele): /ele/import 同时支持 hash 路由
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
主应用模块切换走 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) <noreply@anthropic.com>
This commit is contained in:
10
src/App.tsx
10
src/App.tsx
@@ -46,9 +46,13 @@ function AuthGate() {
|
|||||||
return <UnauthorizedPage message={error || undefined} />;
|
return <UnauthorizedPage message={error || undefined} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 隐藏后端管理页:仅通过 /ele/import 直接访问,主导航不出现
|
// 隐藏后端管理页:通过 /ele/import 或 #/ele/import 直接访问,主导航不出现
|
||||||
if (typeof window !== 'undefined' && window.location.pathname === '/ele/import') {
|
if (typeof window !== 'undefined') {
|
||||||
return <EleImportPage />;
|
const path = window.location.pathname;
|
||||||
|
const hash = window.location.hash;
|
||||||
|
if (path === '/ele/import' || hash === '#/ele/import' || hash === '#ele/import') {
|
||||||
|
return <EleImportPage />;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return <Shell modules={modules} />;
|
return <Shell modules={modules} />;
|
||||||
|
|||||||
Reference in New Issue
Block a user