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

@@ -50,10 +50,11 @@ class Activity(models.Model):
@property
def display_banner_url(self):
"""
获取Banner显示的URL优先使用上传的图片
获取Banner显示的URL优先使用上传的图片,返回相对路径避免容器内部地址
"""
if self.banner:
return self.banner.url
if self.banner and self.banner.name:
from django.conf import settings
return settings.MEDIA_URL + self.banner.name
return self.banner_url
@property