百度地图 跨域问题 求指教~

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) {
        
        
        }
 
      })
阅读 3.8k
1 个回答

在百度地图开放平台的控制台配置Referer白名单

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题