flat: jsonp

This commit is contained in:
Apcallover
2024-04-15 15:30:10 +08:00
parent f99816be2a
commit 687047f7d7
4 changed files with 31 additions and 9 deletions

View File

@@ -3,15 +3,30 @@ import {
} from '@/untils/AxiosUtils.js';
/*逆地址解析*/
export const getcoder = (location, key, get_poi) => {
return request({
url: 'https://apis.map.qq.com/ws/geocoder/v1',
method: 'get',
params: {
return new Promise((resolve, reject) => {
const paramsData = {
location,
key,
get_poi
get_poi,
output: 'jsonp'
}
jsonp('https://apis.map.qq.com/ws/geocoder/v1', paramsData, 30000)
.then((response) => {
console.log('response', response)
resolve(response)
}).catch(err => {
reject(err)
})
})
// return request({
// url: 'https://apis.map.qq.com/ws/geocoder/v1',
// method: 'get',
// params: {
// location,
// key,
// get_poi
// }
// })
}
/*关键词输入提示*/