refactor: 彻底移除 /posts/new 旧编辑器,统一迁移至 /studio/write
- 删除 /posts/new 路由,不再保留任何兼容层 - /posts/:id/edit 改为 301 跳转 /studio/write?id=:id - 删除 posts/new.html 模板和 editor.js - 移除 PostController.EditPage/Create/Update/Delete 孤儿方法 - 移除 /api/posts POST/PUT/DELETE 孤儿 API(保留 submit 和 upload-image) - posts/show.html 编辑链接指向 /studio/write
This commit is contained in:
@ -40,11 +40,10 @@ func setupFrontendRoutes(r *gin.Engine, cfg *config.Config, d *dependencies) {
|
||||
|
||||
// 帖子页面
|
||||
pages.GET("/posts", d.postCtrl.ListPage)
|
||||
pages.GET("/posts/new", d.authMdw.Required(), func(c *gin.Context) {
|
||||
c.Redirect(http.StatusMovedPermanently, "/studio/write")
|
||||
})
|
||||
pages.GET("/posts/:id", d.postCtrl.ShowPage)
|
||||
pages.GET("/posts/:id/edit", d.authMdw.Required(), d.postCtrl.EditPage)
|
||||
pages.GET("/posts/:id/edit", d.authMdw.Required(), func(c *gin.Context) {
|
||||
c.Redirect(http.StatusMovedPermanently, "/studio/write?id="+c.Param("id"))
|
||||
})
|
||||
|
||||
// 创作中心(需登录)
|
||||
studioPages := pages.Group("/studio")
|
||||
|
||||
Reference in New Issue
Block a user