const geoJson = proxy.$service.get('/json/json.json', {}).then((geoJson) => {
return geoJson
})
console.log(geoJson, '分割线', json)
const geoJson = proxy.$service.get('/json/json.json', {}).then((geoJson) => {
console.log(geoJson, '分割线', json)
return geoJson
})
应该在then的回调函数里面打印结果。
建议:不要起相同的名字。
const 声明的 geoJson 的值并不是 then 中return 的geoJson。then里面return的值是传递给下一个then的回调函数的。
再
.then(真正的值 => { // 处理之 })
一次。或者用 async function: