File tree Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Original file line number Diff line number Diff line change @@ -26,25 +26,6 @@ type ActivityTickerProps = {
2626 className ?: string ;
2727} ;
2828
29- /**
30- * 将 JSON 内的 coverUrl 解析为可供 next/image 使用的绝对路径。
31- * - 保留 http 链接(常见于 Discord CDN)
32- * - 将 `./assets/` 前缀映射到 `public/event-assets/`
33- * - 其它情况按原值返回,方便未来扩展
34- */
35- function resolveCoverUrl ( coverUrl : string ) : string {
36- if ( coverUrl . startsWith ( "http" ) ) {
37- return coverUrl ;
38- }
39-
40- if ( coverUrl . startsWith ( "./assets/" ) ) {
41- const filename = coverUrl . replace ( "./assets/" , "" ) ;
42- return `/event-assets/${ filename } ` ;
43- }
44-
45- return coverUrl ;
46- }
47-
4829/**
4930 * 首页活动轮播组件:
5031 * - 读取 event.json 配置的活动数量
@@ -93,7 +74,7 @@ export function ActivityTicker({ className }: ActivityTickerProps) {
9374 }
9475
9576 const activeEvent = events [ activeIndex ] ;
96- const coverSrc = resolveCoverUrl ( activeEvent . coverUrl ) ;
77+ const coverSrc = activeEvent . coverUrl ;
9778 const showPlayback = activeEvent . deprecated && Boolean ( activeEvent . playback ) ;
9879
9980 return (
You can’t perform that action at this time.
0 commit comments