1、初始化项目

This commit is contained in:
2025-05-12 14:49:01 +08:00
commit 20a741ae11
242 changed files with 29323 additions and 0 deletions

29
common/middleware/demo.go Normal file
View File

@ -0,0 +1,29 @@
package middleware
import (
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/sdk/config"
"net/http"
)
func DemoEvn() gin.HandlerFunc {
return func(c *gin.Context) {
method := c.Request.Method
if config.ApplicationConfig.Mode == "demo" {
if method == "GET" ||
method == "OPTIONS" ||
c.Request.RequestURI == "/api/v1/login" ||
c.Request.RequestURI == "/api/v1/logout" {
c.Next()
} else {
c.JSON(http.StatusOK, gin.H{
"code": 500,
"msg": "谢谢您的参与,但为了大家更好的体验,所以本次提交就算了吧!\U0001F600\U0001F600\U0001F600",
})
c.Abort()
return
}
}
c.Next()
}
}