diff --git a/src/views/contentData/headerTop/index.vue b/src/views/contentData/headerTop/index.vue index 40d5dc1..c4be021 100644 --- a/src/views/contentData/headerTop/index.vue +++ b/src/views/contentData/headerTop/index.vue @@ -95,6 +95,11 @@ export default { }, methods: { updateMapPosition(lng, lat) { + // 移除旧的 positionLayer(如果存在) + if (this.positionLayer) { + window.olMap.removeLayer(this.positionLayer); + this.positionLayer = null; + } let center = fromLonLat([lng, lat]); var iconFeature = new Feature({ geometry: new Point(center), diff --git a/src/views/login/index.vue b/src/views/login/index.vue index f275319..7c816fe 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -88,7 +88,7 @@ export default { // localStorage.setItem("PositionIds", res.data.PositionIds); // 阵地权限 this.$router.push("/"); let arrParams = res.data.positionIds; - loginPosition(arrParams).then((positionRes) => { + loginPosition([arrParams]).then((positionRes) => { if (positionRes.code === 0) { localStorage.setItem("PositionIds", positionRes.data); // 阵地权限 this.$message.success("登录成功"); diff --git a/vue.config.js b/vue.config.js index a9427b6..91b1fc4 100644 --- a/vue.config.js +++ b/vue.config.js @@ -18,7 +18,7 @@ module.exports = defineConfig({ productionSourceMap: false, transpileDependencies: true, devServer: { - host: "192.168.79.70", + host: "0.0.0.0", port: 9997, open: true, proxy: {}