优化首页公告与轮播图

This commit is contained in:
yml
2026-05-23 01:50:45 +08:00
parent 96d87483b0
commit c9db34ddda
14 changed files with 797 additions and 91 deletions
+6 -2
View File
@@ -48,9 +48,13 @@ func (s *Service) Upload(req uploadRequest) (*UploadDTO, error) {
if err != nil {
return nil, err
}
url := "/api/files/object?key=" + key
if scene == "home-banner" {
url = "/api/public/files/object?key=" + key
}
return &UploadDTO{
ObjectKey: key,
URL: "/api/files/object?key=" + key,
URL: url,
Filename: req.Header.Filename,
ContentType: contentType,
Size: req.Header.Size,
@@ -60,7 +64,7 @@ func (s *Service) Upload(req uploadRequest) (*UploadDTO, error) {
func normalizeScene(scene string) string {
scene = strings.TrimSpace(strings.ToLower(scene))
switch scene {
case "listing", "handoff", "dispute", "realname", "avatar":
case "listing", "handoff", "dispute", "realname", "avatar", "home-banner":
return scene
default:
return "misc"