R110/A2,A3 补齐手机和PC路由分流
这个提交包含在:
@@ -6,11 +6,14 @@ import { Sidebar } from "../components/navigation/Sidebar";
|
||||
import { Topbar } from "../components/navigation/Topbar";
|
||||
import { resolvePageMeta } from "../features/navigation/schema";
|
||||
import { writeRecentVisit } from "../lib/recentVisits";
|
||||
import { shouldPreferMobileWorkplace } from "../lib/runtimeContext";
|
||||
import { resolveMobileEquivalentPath, shouldPreferMobileWorkplace } from "../lib/runtimeContext";
|
||||
|
||||
export function AppShellLayout() {
|
||||
const location = useLocation();
|
||||
const isMobileRoute = location.pathname.startsWith("/mobile");
|
||||
const mobileEquivalentPath = !isMobileRoute && shouldPreferMobileWorkplace()
|
||||
? resolveMobileEquivalentPath(location.pathname, location.search)
|
||||
: null;
|
||||
|
||||
useEffect(() => {
|
||||
const pathname = location.pathname;
|
||||
@@ -20,8 +23,8 @@ export function AppShellLayout() {
|
||||
writeRecentVisit(pathname, resolvePageMeta(pathname).title);
|
||||
}, [location.pathname]);
|
||||
|
||||
if (location.pathname === "/portal" && shouldPreferMobileWorkplace()) {
|
||||
return <Navigate to="/mobile" replace />;
|
||||
if (mobileEquivalentPath && mobileEquivalentPath !== `${location.pathname}${location.search}`) {
|
||||
return <Navigate to={mobileEquivalentPath} replace />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
在新工单中引用
屏蔽一个用户