package middleware import ( "github.com/gin-gonic/gin" ) func OPTIONS(c *gin.Context) { //// 跨域 //if config.AppEnv.Env() == gsf.EnvLocal { // c.Writer.Header().Set("Access-Control-Allow-Headers", "*") // c.Writer.Header().Set("Access-Control-Allow-Origin", "*") //} //// POST options 预请求 //if c.Request.Method == "OPTIONS" { // c.AbortWithStatus(204) // return //} c.Next() }