fix: 修复通知系统链接错误、标记已读失败及帖子404页渲染异常
- 修复 post_rejected 通知链接到帖子详情页(原来链接到 /studio/posts) - 为 audit_approved/audit_rejected 通知添加链接到 /settings - 通知已读标记改用 fetch keepalive 代替 sendBeacon,附带 CSRF token,避免页面跳转时请求丢失 - 修复 repository 层 id 列名应为 uid(BaseModel 定义 primarykey column:uid) - 帖子404页添加 ExtraCSS 引入 posts.css,修复 SVG 图标无尺寸约束全屏渲染异常
This commit is contained in:
@ -78,7 +78,8 @@ func (ctrl *PostController) ShowPage(c *gin.Context) {
|
||||
id, err := strconv.ParseUint(c.Param("id"), 10, 64)
|
||||
if err != nil {
|
||||
c.HTML(http.StatusNotFound, "posts/404.html", common.BuildPageData(c, gin.H{
|
||||
"Title": "未找到",
|
||||
"Title": "未找到",
|
||||
"ExtraCSS": "/static/css/posts.css",
|
||||
}))
|
||||
return
|
||||
}
|
||||
@ -86,7 +87,8 @@ func (ctrl *PostController) ShowPage(c *gin.Context) {
|
||||
post, err := ctrl.postService.GetByID(uint(id))
|
||||
if err != nil {
|
||||
c.HTML(http.StatusNotFound, "posts/404.html", common.BuildPageData(c, gin.H{
|
||||
"Title": "未找到",
|
||||
"Title": "未找到",
|
||||
"ExtraCSS": "/static/css/posts.css",
|
||||
}))
|
||||
return
|
||||
}
|
||||
@ -101,7 +103,8 @@ func (ctrl *PostController) ShowPage(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
c.HTML(http.StatusNotFound, "posts/404.html", common.BuildPageData(c, gin.H{
|
||||
"Title": "未找到",
|
||||
"Title": "未找到",
|
||||
"ExtraCSS": "/static/css/posts.css",
|
||||
}))
|
||||
return
|
||||
}
|
||||
@ -145,7 +148,8 @@ func (ctrl *PostController) EditPage(c *gin.Context) {
|
||||
id, err := strconv.ParseUint(c.Param("id"), 10, 64)
|
||||
if err != nil {
|
||||
c.HTML(http.StatusNotFound, "posts/404.html", common.BuildPageData(c, gin.H{
|
||||
"Title": "未找到",
|
||||
"Title": "未找到",
|
||||
"ExtraCSS": "/static/css/posts.css",
|
||||
}))
|
||||
return
|
||||
}
|
||||
@ -153,7 +157,8 @@ func (ctrl *PostController) EditPage(c *gin.Context) {
|
||||
post, err := ctrl.postService.GetByID(uint(id))
|
||||
if err != nil || post.Status == model.PostStatusPending || post.IsLocked {
|
||||
c.HTML(http.StatusNotFound, "posts/404.html", common.BuildPageData(c, gin.H{
|
||||
"Title": "未找到或无法编辑",
|
||||
"Title": "未找到或无法编辑",
|
||||
"ExtraCSS": "/static/css/posts.css",
|
||||
}))
|
||||
return
|
||||
}
|
||||
@ -161,7 +166,8 @@ func (ctrl *PostController) EditPage(c *gin.Context) {
|
||||
uid, role, _ := common.GetGinUser(c)
|
||||
if !ctrl.postService.IsPostAccessible(uid, role, post.UserID) {
|
||||
c.HTML(http.StatusNotFound, "posts/404.html", common.BuildPageData(c, gin.H{
|
||||
"Title": "未找到",
|
||||
"Title": "未找到",
|
||||
"ExtraCSS": "/static/css/posts.css",
|
||||
}))
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user