flat: 暂存
This commit is contained in:
22
api/map.js
22
api/map.js
@@ -16,7 +16,9 @@ export const getcoder = (location, key, get_poi) => {
|
||||
jsonp('https://apis.map.qq.com/ws/geocoder/v1', paramsData, 30000)
|
||||
.then((response) => {
|
||||
console.log('response', response)
|
||||
resolve(response)
|
||||
resolve({
|
||||
data: response
|
||||
})
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
@@ -34,12 +36,20 @@ export const getcoder = (location, key, get_poi) => {
|
||||
|
||||
/*关键词输入提示*/
|
||||
export const querySearch = (keyword, key) => {
|
||||
return request({
|
||||
url: 'https://apis.map.qq.com/ws/place/v1/suggestion',
|
||||
method: 'get',
|
||||
params: {
|
||||
return new Promise((resolve, reject) => {
|
||||
const paramsData = {
|
||||
keyword,
|
||||
key
|
||||
key,
|
||||
output: 'jsonp'
|
||||
}
|
||||
jsonp('https://apis.map.qq.com/ws/place/v1/suggestion', paramsData, 30000)
|
||||
.then((response) => {
|
||||
console.log('response', response)
|
||||
resolve({
|
||||
data: response
|
||||
})
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user