This commit is contained in:
Wyle.Gong-巩文昕
2025-04-22 16:42:48 +08:00
commit 67b0ad2723
95 changed files with 10508 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
package utils
import (
"github.com/veypi/OneBD/rest"
)
func SetCORSHeaders(x *rest.X) {
x.ResponseWriter().Header().Set("Access-Control-Allow-Origin", "*")
x.ResponseWriter().Header().Set("Access-Control-Allow-Methods", "GET, POST, PATCH, DELETE, OPTIONS, FETCH, PUT")
x.ResponseWriter().Header().Set("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, token, Accept")
}