动态配置大屏跳转地址

This commit is contained in:
binbin_pan 2024-06-19 10:12:35 +08:00
parent 357f0350c6
commit 0616cc2bf0
2 changed files with 13 additions and 11 deletions

View File

@ -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,

View File

@ -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'); // 线
},
},
}