feat: 产品视频改后台上传,promotion-media 公开访问;gitignore 大文件;保留原文件名上传
Made-with: Cursor
This commit is contained in:
@@ -79,7 +79,7 @@ func main() {
|
||||
}
|
||||
|
||||
r := gin.Default()
|
||||
r.MaxMultipartMemory = 200 << 20 // 200MB,与 Nginx client_max_body_size 一致,避免上传 413
|
||||
r.MaxMultipartMemory = 32 << 20 // 大单片先落临时文件;整体体积受 Nginx client_max_body_size 限制
|
||||
r.Use(middleware.ErrorLogger())
|
||||
|
||||
// CORS(ALLOWED_ORIGINS 为空则允许所有来源;否则仅允许配置的域名)
|
||||
@@ -215,6 +215,8 @@ func main() {
|
||||
web.GET("/info", func(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"message": "web api"})
|
||||
})
|
||||
// 推广/产品视频:站点 uploads 下 promotion 目录(无需鉴权,与后台上传到 promotion/… 对应)
|
||||
web.GET("/sites/:site_id/promotion-media/*filepath", handlers.ServePromotionMedia)
|
||||
// 可下载资源公开下载(首页等链接指向此路径)
|
||||
web.GET("/sites/:site_id/assets/:asset_id/download", handlers.DownloadSiteAsset)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user