feat: 跨域中间件
This commit is contained in:
@@ -37,6 +37,7 @@ func LoggerTrace(next http.Handler) http.Handler {
|
||||
})
|
||||
}
|
||||
|
||||
// 已禁用
|
||||
func OptionProcess(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method == "OPTIONS" {
|
||||
@@ -48,6 +49,7 @@ func OptionProcess(next http.Handler) http.Handler {
|
||||
})
|
||||
}
|
||||
|
||||
// 已禁用
|
||||
func CheckPermission(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
token := r.Header.Get("AccessToken")
|
||||
|
||||
Reference in New Issue
Block a user