remove demo middleware

This commit is contained in:
zhangwenjian committed 2020-05-05 12:25:17 +08:00
1 parent de41e30aa1
commit 9ea3ccc064
2 files changed
-28

No files matched your search

-27
View File
@@ -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()
}
}
}