import { Navigate, useLocation } from 'react-router-dom'; import { getStoreProfile, hasShopWxSession } from '../lib/api'; import { useStoreSession } from '../contexts/StoreSessionContext'; const PUBLIC_PATHS = new Set(['/login', '/legal/user-agreement', '/legal/privacy-policy']); const SELECT_STORE_PATH = '/select-store'; export default function AuthGate({ children }: { children: React.ReactNode }) { const { ready, authenticated, needsSelectStore } = useStoreSession(); const location = useLocation(); if (!ready) { return (
加载中…