update
This commit is contained in:
@ -36,7 +36,7 @@ func New(opt Options) *gin.Engine {
|
||||
// 前端用 toAbs() 拼上 base 后直接访问,因此这里必须对外提供静态文件。
|
||||
r.Static(opt.Config.Upload.URLPrefix, opt.Config.Upload.Dir)
|
||||
|
||||
api := r.Group("/api")
|
||||
api := r.Group("/api/v1")
|
||||
{
|
||||
// 健康检查,供容器 / 反向代理探活
|
||||
api.GET("/health", opt.Health.Check)
|
||||
@ -52,10 +52,9 @@ func New(opt Options) *gin.Engine {
|
||||
// 账号体系:注册 / 登录 / 登出 / 当前用户(JWT 无状态)
|
||||
auth := api.Group("/auth")
|
||||
{
|
||||
auth.POST("/register", opt.Auth.Register)
|
||||
auth.POST("/login", opt.Auth.Login)
|
||||
auth.POST("/logout", opt.Auth.Logout)
|
||||
auth.GET("/me", middleware.Auth(opt.JWT), opt.Auth.Me)
|
||||
auth.POST("/register", opt.Auth.Register)
|
||||
auth.POST("/login", opt.Auth.Login)
|
||||
auth.GET("/me", middleware.Auth(opt.JWT), opt.Auth.Me)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user