beego.go
554 字节
package beego
import (
"github.com/astaxie/beego"
"github.com/astaxie/beego/plugins/cors"
_ "gitlab.fjmaimaimai.com/mmm-go/godevp/pkg/port/beego/routers"
)
func init() {
beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
AllowOrigins: []string{"*"},
AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin"},
ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin"},
AllowCredentials: true,
}))
}