Fix http auth and sdk errors

This commit is contained in:
若海
2024-01-10 09:59:47 +08:00
parent f705ee72cc
commit cd19e7d3f8
15 changed files with 195 additions and 252 deletions
+2 -2
View File
@@ -29,8 +29,8 @@ func ApiGuard(c *gin.Context) {
func SwagGuard(c *gin.Context) {
if !args.Httpd.Swag && strings.HasPrefix(c.Request.URL.Path, "/swag") {
c.Set("Error", gin.H{"Code": 403, "Message": "功能已禁用"})
c.Set("ExitCode", 403)
c.Header("Content-Type", "text/html; charset=utf-8")
c.String(200, "功能已禁用")
c.Abort()
}