作者 唐旭辉

跨域调试修改

... ... @@ -81,14 +81,12 @@ var AllowOption = func(ctx *context.Context) {
return
}
f := cors.Allow(&cors.Options{
// AllowOrigins: []string{"*"}, //允许的请求来源
AllowMethods: []string{"POST", "GET", "OPTIONS", "PUT", "DELETE"}, //允许的请求类型
// AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin",
// "x-mmm-cid", "x-mmm-uid", "x-mmm-accesstoken", "x-mmm-refreshtoken"}, //允许的头部信息
AllowHeaders: []string{"*"},
AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin",
"x-mmm-cid", "x-mmm-uid", "x-mmm-accesstoken", "x-mmm-refreshtoken"}, //允许的头部信息
ExposeHeaders: []string{"Content-Length", "Content-Type", "Access-Control-Allow-Origin"}, //允许暴露的头信息
AllowCredentials: false,
AllowAllOrigins: true, //不允许共享AuthTuffic证书
AllowCredentials: false, //不允许共享AuthTuffic证书
AllowAllOrigins: true, //允许的请求来源
})
f(ctx)
ctx.Output.Body([]byte("{}"))
... ...