修复跨域问题
parent
4c3059ef80
commit
e275a3e2c8
2
main.go
2
main.go
|
@ -44,7 +44,7 @@ func InitLogs() {
|
||||||
}
|
}
|
||||||
func CORSMiddleware(c *gin.Context) {
|
func CORSMiddleware(c *gin.Context) {
|
||||||
c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE, UPDATE")
|
c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE, UPDATE")
|
||||||
c.Writer.Header().Set("Access-Control-Allow-Origin", "http://localhost:8080,https://https://www.testingcloud.club/,https://https://testingcloud.club/")
|
c.Writer.Header().Set("Access-Control-Allow-Origin", "http://localhost:8080,https://www.testingcloud.club/,https://testingcloud.club/")
|
||||||
c.Writer.Header().Set("Access-Control-Max-Age", "86400")
|
c.Writer.Header().Set("Access-Control-Max-Age", "86400")
|
||||||
c.Writer.Header().Set("Access-Control-Allow-Headers",
|
c.Writer.Header().Set("Access-Control-Allow-Headers",
|
||||||
"X-Requested-With," +
|
"X-Requested-With," +
|
||||||
|
|
Loading…
Reference in New Issue