第一版完成
This commit is contained in:
11
internal/middleware/cors.go
Normal file
11
internal/middleware/cors.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
)
|
||||
|
||||
// CORS 跨域中间件
|
||||
func CORS(r *ghttp.Request) {
|
||||
r.Response.CORSDefault()
|
||||
r.Middleware.Next()
|
||||
}
|
||||
Reference in New Issue
Block a user