Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.
。。。。
php设置头:
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, x-file-name");
。。。。
其他情况解决方案:
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, PUT,DELETE');
通过返回的错误信息,适当修改以上代码的参数。