update project path
This commit is contained in:
1 parent
26acdbd0d1
commit
e027e6a259
76 files changed
+2562
-106
No files matched your search
@@ -0,0 +1,27 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"go-admin/config"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func DemoEvn() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
if config.ApplicationConfig.Env == "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": config.ApplicationConfig.EnvMsg,
|
||||
})
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
} else {
|
||||
c.Next()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user