res判断

This commit is contained in:
liuye
2024-05-22 11:56:20 +08:00
parent 9bc3e453c0
commit 080206c1c5

View File

@@ -97,9 +97,8 @@ export default {
type: 'wgs84', // 返回可以用于uni.openLocation的经纬度默认为wgs84的gps坐标
success : (res) => {
let location = `${res.latitude}, ${res.longitude}`
console.log(location)
this.$instance.post(`/admin/area/reverseGeocoding?location=${location}`).then(res => {
if(res.code == 0) {
if(res && res.code == 0){
this.areaId = res.data.result.addressComponent.adcode + '000000'
}
})