feat: update openapi page logic

This commit is contained in:
engigu
2026-03-10 16:21:09 +08:00
parent 27a7bfb147
commit 03ee39fccf
3 changed files with 42 additions and 21 deletions
+2 -6
View File
@@ -40,13 +40,9 @@ func initOpenAPIRoutes(root *gin.RouterGroup, urlPrefix string) {
return
}
// 执行认证
middleware.SwaggerAuth()(c)
// 执行主站 Cookie 认证
middleware.AuthRequired()(c)
if c.IsAborted() {
// 如果认证失败(且被中间件置为 404,如密码错误且我们想要隐藏它)
if c.Writer.Status() == http.StatusNotFound {
serveSPA(c, urlPrefix, 404)
}
return
}