verified_user
diff --git a/apps/h5-shop/src/components/AuthGate.tsx b/apps/h5-shop/src/components/AuthGate.tsx
index 46fee16..ab26614 100644
--- a/apps/h5-shop/src/components/AuthGate.tsx
+++ b/apps/h5-shop/src/components/AuthGate.tsx
@@ -1,5 +1,4 @@
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']);
@@ -26,10 +25,6 @@ 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
;
- }
return
;
}
diff --git a/apps/h5-shop/src/components/WeakNetFallbackPanel.tsx b/apps/h5-shop/src/components/WeakNetFallbackPanel.tsx
index bcf49c1..0a96280 100644
--- a/apps/h5-shop/src/components/WeakNetFallbackPanel.tsx
+++ b/apps/h5-shop/src/components/WeakNetFallbackPanel.tsx
@@ -19,6 +19,7 @@ export default function WeakNetFallbackPanel({ redeemToken, failCount }: Props)
const [photoResourceId, setPhotoResourceId] = useState('');
const [result, setResult] = useState
(null);
const [msg, setMsg] = useState('');
+ const [showAlbumFallback, setShowAlbumFallback] = useState(false);
async function handleFile(file: File) {
setUploading(true);
@@ -49,7 +50,11 @@ export default function WeakNetFallbackPanel({ redeemToken, failCount }: Props)
}
} catch (e) {
const text = e instanceof Error ? e.message : '选图失败';
- if (!/cancel/i.test(text)) setMsg(text);
+ if (!/cancel/i.test(text)) {
+ setMsg(`${text},可改从系统相册选择`);
+ setShowAlbumFallback(true);
+ inputRef.current?.click();
+ }
} finally {
setUploading(false);
}
@@ -120,11 +125,13 @@ export default function WeakNetFallbackPanel({ redeemToken, failCount }: Props)
ref={inputRef}
type="file"
accept="image/*"
- capture="environment"
hidden
onChange={(e) => {
const file = e.target.files?.[0];
- if (file) void handleFile(file);
+ if (file) {
+ setShowAlbumFallback(false);
+ void handleFile(file);
+ }
}}
/>
{previewUrl && (
@@ -134,6 +141,16 @@ export default function WeakNetFallbackPanel({ redeemToken, failCount }: Props)
+ {showAlbumFallback && isWechatEnv() && (
+
+ )}
);