var config={
method:'post',
url: "/backUser/login",
data:{username:'advance',password:123456},
headers: {'X-Requested-With': 'XMLHttpRequest'},
requestHeader:{'Content-Type':'application/json'},
responseType: '
}
axios(config).then(function(res){console.log(res)}).catch(function(err){console.log(err)})
OPTIONS http://120.77.246.117:8080/momingtang/backUser/login 403 (Forbidden)
XMLHttpRequest cannot load http://120.77.246.117:8080/momingtang/backUser/login. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8085' is therefore not allowed access. The response had HTTP status code 403.
Login.vue?49ba:70
Error: Network Error
at createError (eval at <anonymous> (app.js:1860), <anonymous>:15:15)
at XMLHttpRequest.handleError (eval at <anonymous> (app.js:1842), <anonymous>:87:14)
data 改成 params
已经解决了,多谢各位啦
@ddssd
怎么解决的
前端的萤火虫
2个月前 粘贴的图片是对的,已使用。
试试看这样可行不