if (true)
{
$.ajax({
url: 'http://IP地址/sap/bc/zbaw_pp_mes_bg?sap-client=120&ORIGINSYSTEM=MES&TARGETSYSTEM=SAP&NAME=002',
type: 'POST',
data: JsonData,
contentType: "application/json;charset=utf-8",
dataType: 'JSON',
crossDomain: true,
async: false,
// header:true,
success: function (data) {
console.log(data);
},
error: function (eror) {
console.log(eror);
}
});
}
请求异常报错405
使用jsonp
请说出解决方案或者给个代码参考一下实现Ajax跨域调用接口
可以配置一下代理试试
我写了一篇nginx配置代理的文章,你可以参考一下,将前端网页和接口都代理到localhost
https://heerey.blog.csdn.net/article/details/125700720
直接jdk动态代理
dataType 值设置为 jsonp
配置文件配置一下这段代码试试 <system.webServer>
</system.webServer>