https://api.map.baidu.com/rev...
单独开页面调用没问题,但是在程序中会有跨域问题
has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
vconsole.min.js?2f0e:10
程序
const url = https://api.map.baidu.com/reverse_geocoding/v3/?ak=我的AK&output=json&coordtype=wgs84ll&location=${point.lat},${point.lng}
httpUtil.get(url).then(res => {
console.info('baidu ReverseGeocoding', res)
if (res && res.result) {
}
})
在百度地图开放平台的控制台配置Referer白名单