From 3d694114812dbfe4222fe9575cd01cc96cb28bdf Mon Sep 17 00:00:00 2001 From: zengmingjie Date: Wed, 25 Jun 2025 00:12:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B9=8B=E5=89=8D=E7=9A=84?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E5=9B=BE=E6=A0=87\=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=98=B2=E5=8C=BA=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/contentData/headerTop/index.vue | 5 +++++ src/views/login/index.vue | 2 +- vue.config.js | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) 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: {}