diff --git a/src/store/piniaIndex.js b/src/store/piniaIndex.js index 6be6362..9b712dd 100644 --- a/src/store/piniaIndex.js +++ b/src/store/piniaIndex.js @@ -27,6 +27,7 @@ const instance = defineStore('user', { actions: { getPosition() { + if (this.position.latitude && this.position.longitude) return initAMap().then(() => { let AMap = Vue.prototype.$AMap let geolocation = new AMap.Geolocation({