I want to use ide/webservice-geocoding-abroad" rel=" nofollow noreferrer "> reverse geocoding API of Baidu Map, so I sign up for Baidu account and set up an application, as shown below:
when I use axios to request, I report a cross-domain error
axios.get("http://api.map.baidu.com/geocoder/v2/", {
params: {
ak: "", //
location: e.point.lat + "," + e.point.lng
}
}).then(res => {
console.log(res)
})
Cross-domain error:
Access to XMLHttpRequest at" http://api.map.baidu.com/geoc." from origin" http://test.lalei.com" has been blocked by CORS policy: No "Access-Control-Allow-Origin" header is present on the requested resource.
for security reasons, ak didn"t write it out, ha