feat: 统一文件上传接口 + 模板图片展示 + 导航页 + 侧边栏调整

This commit is contained in:
admin
2026-07-10 20:43:02 +08:00
parent cbd0430452
commit ce6823e282
25 changed files with 933 additions and 166 deletions

View File

@@ -63,6 +63,9 @@ func Setup(
})
})
// 静态文件服务:上传的文件可通过 /uploads/* 访问
r.Static("/uploads", cfg.Upload.Path)
// API v1 路由组
api := r.Group("/api/v1")
{
@@ -155,8 +158,11 @@ func Setup(
user.PUT("/profile", userH.UpdateProfile)
user.PUT("/password", userH.ChangePassword)
}
// 文件上传
// 文件上传(统一上传接口,支持按模块分类)
authed.POST("/upload", uploadH.Upload)
authed.GET("/upload/list", uploadH.ListFiles)
authed.GET("/upload/modules", uploadH.GetModules)
authed.DELETE("/upload", uploadH.DeleteFile)
}
// 管理端路由(需要登录 + admin 角色)