作者 yangfu

跨域设置

@@ -67,7 +67,7 @@ func AllowCors() func(ctx *context.Context) { @@ -67,7 +67,7 @@ func AllowCors() func(ctx *context.Context) {
67 ctx.Output.Header("Access-Control-Allow-Methods", "OPTIONS,DELETE,POST,GET,PUT,PATCH") 67 ctx.Output.Header("Access-Control-Allow-Methods", "OPTIONS,DELETE,POST,GET,PUT,PATCH")
68 //ctx.Output.Header("Access-Control-Max-Age", "3600") 68 //ctx.Output.Header("Access-Control-Max-Age", "3600")
69 //ctx.Output.Header("Access-Control-Allow-Headers", "*,x-mmm-version") 69 //ctx.Output.Header("Access-Control-Allow-Headers", "*,x-mmm-version")
70 - ctx.Output.Header("Access-Control-Allow-Headers", "Content-Type,X-Mmm-Accesstoken,X-Mmm-Devicetype,X-Mmm-Sign,X-Mmm-Timestamp,X-Mmm-Uuid,X-Mmm-Version") 70 + ctx.Output.Header("Access-Control-Allow-Headers", "Content-Type,X-Mmm-Accesstoken,X-Mmm-Devicetype,X-Mmm-Sign,X-Mmm-Timestamp,X-Mmm-Uuid,X-Mmm-Version,x-mmm-appname,*")
71 ctx.Output.Header("Access-Control-Allow-Credentials", "true") 71 ctx.Output.Header("Access-Control-Allow-Credentials", "true")
72 ctx.Output.Header("Access-Control-Allow-Origin", "*") //origin 72 ctx.Output.Header("Access-Control-Allow-Origin", "*") //origin
73 if ctx.Input.Method() == http.MethodOptions { 73 if ctx.Input.Method() == http.MethodOptions {