From 0616cc2bf05c4efa8c2b0b071c58a3144ec7022f Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Wed, 19 Jun 2024 10:12:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E9=85=8D=E7=BD=AE=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F=E8=B7=B3=E8=BD=AC=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sgzb-ui/src/utils/globalUrl.js | 9 ++++++++- sgzb-ui/src/views/dashboard.vue | 15 +++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/sgzb-ui/src/utils/globalUrl.js b/sgzb-ui/src/utils/globalUrl.js index 114be562..f0887eff 100644 --- a/sgzb-ui/src/utils/globalUrl.js +++ b/sgzb-ui/src/utils/globalUrl.js @@ -4,7 +4,14 @@ // const qrUrl = 'http://112.29.103.165:21624/qrCode/qrCodePage?qrCode='; //宁夏 // const qrUrl = 'https://z.csgmall.com.cn/gl/qrCode/qrCodePage?qrCode='; //南网 -const qrUrl = process.env.NODE_ENV === 'production' ? 'http://112.29.103.165:21624/qrCode/qrCodePage?qrCode=' : 'http://192.168.0.14:21624/qrCode/qrCodePage?qrCode=' +// const qrUrl = process.env.NODE_ENV === 'production' ? 'http://112.29.103.165:21624/qrCode/qrCodePage?qrCode=' : 'http://192.168.0.14:21624/qrCode/qrCodePage?qrCode=' +let qrUrl = '' +const origin = window.location.origin +if (origin == 'http://112.29.103.165:21624') { + qrUrl = 'http://112.29.103.165:21624/qrCode/qrCodePage?qrCode=' +} else { + qrUrl = 'http://192.168.0.14:21624/qrCode/qrCodePage?qrCode=' +} export default { qrUrl, diff --git a/sgzb-ui/src/views/dashboard.vue b/sgzb-ui/src/views/dashboard.vue index 478d9106..f60c4a30 100644 --- a/sgzb-ui/src/views/dashboard.vue +++ b/sgzb-ui/src/views/dashboard.vue @@ -12,28 +12,23 @@ } }, created() { - if (process.env.NODE_ENV === 'production') { - this.jumpUrl = 'http://112.29.103.165:21624/' + const origin = window.location.origin + if (origin == 'http://112.29.103.165:21624') { + this.jumpUrl = origin } else { - this.jumpUrl = 'http://192.168.0.14:21624/' + this.jumpUrl = 'http://192.168.0.14:21624' } this.openNewWindow() this.$tab.closePage().then(() => {}) }, methods: { openNewWindow() { - // window.open( - // 'http://192.168.0.14:21624/index01.html?token=' + - // localStorage.getItem('token'), - // '_blank', - // ) window.open( - `${this.jumpUrl}index01.html?token=${localStorage.getItem( + `${this.jumpUrl}/index01.html?token=${localStorage.getItem( 'token', )}`, '_blank', ) - // window.open('http://112.29.103.165:21624/index01.html?token='+localStorage.getItem('token'), '_blank'); // 产线 }, }, }