feat(h5-auth): restore partner and shop WeChat login

Re-enable one-tap WeChat login, post-SMS OAuth bind, and quick login gates so partner/shop openId flows work again on staging.
This commit is contained in:
2026-08-02 11:59:23 +08:00
parent 09e732bfa3
commit 3fc2f23e10
5 changed files with 402 additions and 11 deletions
+5
View File
@@ -1,4 +1,5 @@
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']);
@@ -25,6 +26,10 @@ export default function AuthGate({ children }: { children: React.ReactNode }) {
}
if (!authenticated && !PUBLIC_PATHS.has(location.pathname)) {
const profile = getStoreProfile();
if (profile && hasShopWxSession() && location.pathname !== '/login') {
return <Navigate to="/login?quick=1" replace state={{ from: location }} />;
}
return <Navigate to="/login" replace state={{ from: location }} />;
}