Baidu map IP acquires location. The interface has returned success, but a cross-domain error has been reported.

call Baidu Map ip to obtain the location API, and the data has been returned successfully, but a cross-domain error has been reported, resulting in the callback method unable to be executed. Ask for advice
clipboard.png

clipboard.png

Failed to load https://api.map.baidu.com/loc.: No "Access-Control-Allow-Origin" header is present on the requested resource. Origin" https://127.0.0.1:8087" is therefore not allowed access.

this.$http.get(`https://api.map.baidu.com/location/ip?ak=${AK}&coor=bd09l`).then(res => {
      console.log(res);
      this.x = res.location;
      this.y = res.latitude;
      let mk = new BMap.Marker(res.point);
      map.addOverlay(mk);
      map.panTo(res.point);
    })

  1. from the official example, it is supported to add the callback parameter to jsonp form.
  2. backend request.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e8ae3e-1012.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e8ae3e-1012.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?