pull/2/head
xiaozhiyong 2 years ago
parent 4164ce1b5c
commit 01a5a2ad72
  1. 16
      src/store/piniaIndex.js
  2. 4
      vue.config.js

@ -28,7 +28,7 @@ const instance = defineStore('user', {
actions: {
getPosition() {
this.position = { latitude: 36.636753, longitude: 119.11914 }
return
// return
initAMap().then(() => {
// console.log(3)
let AMap = Vue.prototype.$AMap
@ -36,12 +36,14 @@ const instance = defineStore('user', {
// enableHighAccuracy: true // 是否使用高精度定位,默认:true
})
geolocation.getCurrentPosition(function (status, result) {
console.log(2)
if (status === 'complete') {
let { lat: latitude, lng: longitude } = result.position
this.position = { latitude, longitude }
console.log('this.position', this.position)
}
console.log('geolocation.getCurrentPosition')
console.log('status', status)
console.log('result', result)
// if (status === 'complete') {
// let { lat: latitude, lng: longitude } = result.position
// this.position = { latitude, longitude }
// console.log('this.position', this.position)
// }
})
})
return

@ -17,8 +17,8 @@ module.exports = defineConfig({
proxy: {
[process.env.VUE_APP_BASE_API]: {
// target: `http://192.168.1.83:38080`,
// target: `https://www.xingoil.com/adminapi`,
target: `http://uat.xingoil.com/adminapi`,
target: `https://www.xingoil.com/adminapi`,
// target: `http://uat.xingoil.com/adminapi`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save