2025-04-30 15:07:43 +08:00

21 lines
401 B
Go

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()
}