fix: 修复删除资源时未验证所有者的问题
Quality check / Web UI (push) Successful in 9m11s

This commit is contained in:
mei
2026-08-30 17:47:53 +08:00
parent 59cf99ae22
commit 360169ee64
6 changed files with 68 additions and 0 deletions
+3
View File
@@ -40,6 +40,9 @@ func NotFound(c *gin.Context, msg string) { Fail(c, http.StatusNotFound, msg) }
// ServerError 服务端错误
func ServerError(c *gin.Context, msg string) { Fail(c, http.StatusInternalServerError, msg) }
// Forbidden 无权限
func Forbidden(c *gin.Context, msg string) { Fail(c, http.StatusForbidden, msg) }
// FromError 按错误类型选择合适的状态码:
// 参数校验错误返回 400,其余返回 500
func FromError(c *gin.Context, err error, fallback string) {