跨越解决方法:返回包head做相关设置
// Java中设置
response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Headers", "Content-Type");
response.setHeader("Access-Control-Allow-Methods", "GET,POST");
response.setHeader("Allow", "GET,POST");
// PHP设置
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Content-Type');
header('Access-Control-Allow-Methods: GET,POST');
header('Allow: GET,POST');
|