modify cors

This commit is contained in:
Jay 2018-10-14 22:03:26 +08:00
parent 32b048abb4
commit 853f19aa97

View File

@ -39,6 +39,9 @@ func NewServ() *gin.Engine {
corsConfig := cors.DefaultConfig()
corsConfig.AllowCredentials = true
corsConfig.AllowAllOrigins = true
corsConfig.AllowOriginFunc = func(origin string) bool {
return true
}
r.Use(cors.New(corsConfig))
// session
r.Use(sessions.Sessions("ginsess", store))