fix(frontend): keep browser API on same-origin rewrites in dev

Document that NEXT_PUBLIC_WAVELET_BACKEND_URL must stay unset for local
next dev so axios hits /api/* and Next rewrites proxy to the backend.
This commit is contained in:
ryan
2026-07-24 16:37:24 +08:00
parent a4588b05e0
commit 9f15f42b47
75 changed files with 5971 additions and 2450 deletions
@@ -5,6 +5,7 @@ import { ImageOff } from 'lucide-react';
import { cn } from '@/lib/utils';
import { getFileUrl, type ImageQuality } from '@/lib/services/upload/utils';
import { useTranslations } from 'next-intl';
type FileImagePreviewProps = {
fileId: string | number;
@@ -25,6 +26,7 @@ export function FileImagePreview({
}: FileImagePreviewProps) {
const [failed, setFailed] = React.useState(false);
const src = getFileUrl(fileId, quality);
const t = useTranslations('common');
React.useEffect(() => {
setFailed(false);
@@ -34,7 +36,7 @@ export function FileImagePreview({
return (
<div
role='img'
aria-label={`${alt} 加载失败`}
aria-label={`${alt} ${t('loadFailed')}`}
className={cn(
'flex size-full flex-col items-center justify-center gap-1 bg-muted/50 text-muted-foreground',
fallbackClassName,
@@ -47,7 +49,7 @@ export function FileImagePreview({
)}
/>
{variant === 'default' && (
<span className='text-[10px] leading-none'>加载失败</span>
<span className='text-[10px] leading-none'>{t('loadFailed')}</span>
)}
</div>
);