diff --git a/middleware/demo.go b/middleware/demo.go deleted file mode 100644 index 00954dcd..00000000 --- a/middleware/demo.go +++ /dev/null @@ -1,27 +0,0 @@ -package middleware - -import ( - "github.com/gin-gonic/gin" - config2 "go-admin/tools/config" - "net/http" -) - -func DemoEvn() gin.HandlerFunc { - return func(c *gin.Context) { - if config2.ApplicationConfig.Mode == "demo" { - method := c.Request.Method - if method == "GET" || method == "OPTIONS" || c.Request.RequestURI == "/login" || c.Request.RequestURI == "/api/v1/logout" { - c.Next() - } else { - c.JSON(http.StatusOK, gin.H{ - "code": 500, - "msg": config2.ApplicationConfig.DemoMsg, - }) - c.Abort() - return - } - } else { - c.Next() - } - } -} diff --git a/router/router.go b/router/router.go index fcbd4498..6f0ad545 100644 --- a/router/router.go +++ b/router/router.go @@ -25,7 +25,6 @@ func InitRouter() *gin.Engine { r.Use(middleware.Options) r.Use(middleware.Secure) r.Use(middleware.RequestId()) - r.Use(middleware.DemoEvn()) r.GET("/", system.HelloWorld) r.Static("/static", "./static")