前后端分离:ajax发送请求时如何解决跨域问题
前端ajax请求
$.ajax({
xhrFields: {
withCredentials: true
},
crossDomain: true,
type: "POST",
url: "http://IP地址:端口/接口",
data: {
username: "123",
password: "456"
},
// dataType: "json",
success: function(data) {
alert("
原创
2021-06-17 09:50:21 ·
284 阅读 ·
0 评论