mirror of
https://github.com/skyle1995/NetworkAuth.git
synced 2026-05-25 02:24:05 +08:00
修复 维护模式拦截异常的问题
This commit is contained in:
@@ -21,6 +21,11 @@ func MaintenanceMiddleware() gin.HandlerFunc {
|
||||
|
||||
path := c.Request.URL.Path
|
||||
|
||||
if !strings.HasPrefix(path, "/api") {
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
|
||||
// 允许管理员后台相关接口(以便管理员登录关闭维护模式)
|
||||
// 包括登录页、登录接口、API接口、CSRF Token等
|
||||
if strings.HasPrefix(path, "/api/admin") {
|
||||
|
||||
Reference in New Issue
Block a user