cors.go 293 B

12345678910111213141516
  1. /*
  2. * @desc:xxxx功能描述
  3. * @company:云南省奇讯科技有限公司
  4. * @Author: yixiaohu
  5. * @Date: 2021/3/18 16:42
  6. */
  7. package middleware
  8. import "github.com/gogf/gf/net/ghttp"
  9. // CORS 跨域处理中间件
  10. func CORS(r *ghttp.Request) {
  11. r.Response.CORSDefault()
  12. r.Middleware.Next()
  13. }