fix: proxy B站图片 CDN 解决 web 端防盗链图片不显示问题

- dev-proxy.js 新增 /bilibili-img 路由,代理 *.hdslb.com 并注入正确 Referer
- utils/imageUrl.ts 新增 proxyImageUrl(),web 端将图片 URL 转为本地代理地址
- VideoCard / CommentItem / MiniPlayer / [bvid] 对所有 B站图片应用 proxyImageUrl
This commit is contained in:
Developer
2026-03-10 20:47:14 +08:00
parent 4c72ff3cdd
commit 4d71f39ee9
6 changed files with 30 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ import { useRouter } from 'expo-router';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { Ionicons } from '@expo/vector-icons';
import { useVideoStore } from '../store/videoStore';
import { proxyImageUrl } from '../utils/imageUrl';
export function MiniPlayer() {
const { isActive, bvid, title, cover, clearVideo } = useVideoStore();
@@ -42,7 +43,7 @@ export function MiniPlayer() {
onPress={() => router.push(`/video/${bvid}` as any)}
activeOpacity={0.85}
>
<Image source={{ uri: cover }} style={styles.cover} />
<Image source={{ uri: proxyImageUrl(cover) }} style={styles.cover} />
<Text style={styles.title} numberOfLines={1}>{title}</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.closeBtn} onPress={clearVideo}>