jquery请求:
$.ajax({
url: 'http:192.168.2.211:8010/api/login',
type:'post',
'contentType': 'application/json',
data:JSON.stringify({
"account": "superAdmin",
"password": "123456"
}),
success:(res)=>{
console.log("登录接口:", res)
}
})
请求结果:
axios请求:
axios.request({
baseURL: baseUrl,
url: '/api/login',
method: 'post',
headers: {
'Content-Type': 'application/json'
},
data
})
这个问题一般是 content-type 的问题,但是你两次 content-type 是一致的。那么这里应该不是问题点。
看评论你说到了代理,那你问题就出在代理上了,你确认你的代理服务器指向是正确的嘛?
如果是正确的需要你补一个同样的地址的图片出来,方便大家分析问题