feat: 首页配置封面图上传预览,修复系列活动跳转,活动卡片样式优化
All checks were successful
Deploy to Server / deploy (push) Successful in 1m56s

This commit is contained in:
爽哒哒
2026-03-22 00:31:34 +08:00
parent 21f892fdf6
commit 96be8b9eee
6 changed files with 37 additions and 14 deletions

View File

@@ -7,9 +7,8 @@ const { Title } = Typography;
const getImageUrl = (url) => {
if (!url) return '';
if (url.startsWith('http') || url.startsWith('//')) {
try { return new URL(url).pathname; } catch { return url; }
}
// 外部 URL 直接返回,不提取 pathname
if (url.startsWith('http') || url.startsWith('//')) return url;
return url;
};

View File

@@ -396,8 +396,7 @@ const ActivityDetail = () => {
{/* Hero Image with LayoutId for shared transition */}
<div className={styles.detailHeader}>
<motion.img
layoutId={`activity-card-${id}`}
<img
src={activity.display_banner_url || cleanUrl(activity.banner_url) || activity.cover_image || 'https://images.unsplash.com/photo-1540575467063-178a50c2df87?w=800&h=600&fit=crop'}
alt={activity.title}
className={styles.detailImage}