Golang允许跨站Http请求


func (s *Service) Handler(w http.ResponseWriter, request *http.Request) {
    w.Header().Add("Access-Control-Allow-Origin", "*")
    w.Header().Add("Access-Control-Allow-Methods", "GET,POST,PUT,DELETE,PATCH,OPTIONS")
    w.Header().Add("Access-Control-Allow-Headers", "Content-Type, Accept, Authorization")
}