From baebb947169cce9521b25593e4a48ba4ecb388e4 Mon Sep 17 00:00:00 2001 From: zhouzy062 Date: Wed, 27 Mar 2024 09:06:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sgzb-ui/src/main.js | 4 ++++ sgzb-ui/src/utils/globalUrl.js | 19 +++++++++++++++++++ .../src/views/store/label/labelBinding.vue | 3 +-- .../views/store/label/labelBindingHistory.vue | 2 +- sgzb-ui/src/views/store/tools/devices.vue | 2 +- sgzb-ui/vue.config.js | 7 ++++--- 6 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 sgzb-ui/src/utils/globalUrl.js diff --git a/sgzb-ui/src/main.js b/sgzb-ui/src/main.js index a3400115..090086f4 100644 --- a/sgzb-ui/src/main.js +++ b/sgzb-ui/src/main.js @@ -41,6 +41,9 @@ import DictData from '@/components/DictData' import JsonExcel from 'vue-json-excel' Vue.prototype.$eventBus = new Vue() + +import global_ from '@/utils/globalUrl' + // 全局方法挂载 Vue.prototype.getDicts = getDicts Vue.prototype.getConfigKey = getConfigKey @@ -52,6 +55,7 @@ Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.download = download Vue.prototype.downloadJson = downloadJson Vue.prototype.handleTree = handleTree +Vue.prototype.globalUrl = global_ // 全局组件挂载 Vue.component('DictTag', DictTag) diff --git a/sgzb-ui/src/utils/globalUrl.js b/sgzb-ui/src/utils/globalUrl.js new file mode 100644 index 00000000..2b906e1c --- /dev/null +++ b/sgzb-ui/src/utils/globalUrl.js @@ -0,0 +1,19 @@ + +// const qrUrl = 'http://192.168.0.14:21624/qrCode/qrCodePage?qrCode='; //测试 +const qrUrl = 'http://112.29.103.165:21626/qrCode/qrCodePage?qrCode='; //重庆 +// const qrUrl = 'http://112.29.103.165:21624/qrCode/qrCodePage?qrCode='; //宁夏 + + + + +export default { + qrUrl, + } + + + + + + + + diff --git a/sgzb-ui/src/views/store/label/labelBinding.vue b/sgzb-ui/src/views/store/label/labelBinding.vue index 7c516ae6..4dd51c3a 100644 --- a/sgzb-ui/src/views/store/label/labelBinding.vue +++ b/sgzb-ui/src/views/store/label/labelBinding.vue @@ -507,12 +507,11 @@ export default { codeId: true, isShowQrCode: -1, labelmaCode: '', - qrUrl:'http://192.168.0.14:21624/qrCode/qrCodePage?qrCode=', + qrUrl:this.globalUrl.qrUrl, json_fields:{"二维码地址":'exportUrl',"标签编号":'labelCode',"设备编码":'maCode'}, }; }, created() { - console.log(this.userInfo.id) this.getList(); this.getType() this.getTypeList(); diff --git a/sgzb-ui/src/views/store/label/labelBindingHistory.vue b/sgzb-ui/src/views/store/label/labelBindingHistory.vue index 9dd4c61c..36b82fcf 100644 --- a/sgzb-ui/src/views/store/label/labelBindingHistory.vue +++ b/sgzb-ui/src/views/store/label/labelBindingHistory.vue @@ -183,7 +183,7 @@ export default { rowObj: {}, labelmaCode: '', uploadOpen: false, - qrUrl:'http://192.168.0.14:21624/qrCode/qrCodePage?qrCode=', + qrUrl:this.globalUrl.qrUrl, }; }, created() { diff --git a/sgzb-ui/src/views/store/tools/devices.vue b/sgzb-ui/src/views/store/tools/devices.vue index 9ec4807d..0c6eef3a 100644 --- a/sgzb-ui/src/views/store/tools/devices.vue +++ b/sgzb-ui/src/views/store/tools/devices.vue @@ -384,7 +384,7 @@ export default { title: "", uploadOpen: false, qrCode: '', - qrUrl:'http://192.168.0.14:21624/qrCode/qrCodePage?qrCode=', + qrUrl:this.globalUrl.qrUrl, rowObj:{}, // 是否显示弹出层 open: false, diff --git a/sgzb-ui/vue.config.js b/sgzb-ui/vue.config.js index d301597a..3cc7950c 100644 --- a/sgzb-ui/vue.config.js +++ b/sgzb-ui/vue.config.js @@ -27,6 +27,7 @@ module.exports = { lintOnSave: process.env.NODE_ENV === 'development', // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 productionSourceMap: false, + qrUrl:'http://192.168.0.14:21624/qrCode/qrCodePage?qrCode=', // webpack-dev-server 相关配置 devServer: { host: '0.0.0.0', @@ -37,18 +38,18 @@ module.exports = { [process.env.VUE_APP_BASE_API]: { // target: `http://112.29.103.165:21626`,//线上环境-重庆 // target: `http://112.29.103.165:21624`,//线上环境-宁夏 打包前放开数据大屏的路由 - // target: `http://192.168.0.14:21624`,//线上环境 + // target: `http://192.168.0.14:21624`,//线上环境/ // target: `http://1.12.248.179:23028`,//线上环境-南网 // target: `https://test-cc.zhgkxt.com`,//线上环境-南网 // target: `https://z.csgmall.com.cn`, - target: `http://10.40.92.12:8080`,//超 + // target: `http://10.40.92.8:8080`,//超 // target: `http://10.40.92.253:8080`,//韩 // target: `http://10.40.92.209:8080`,//川/ //******** 注意事项 ********* */ //1.全局替换qrUrl二维码扫码提供的网址-发布服务器的地址; - //qrUrl:'http://112.29.103.165:21624/qrCode/qrCodePage?qrCode=' + //qrUrl:'http://192.168.0.14:21624/qrCode/qrCodePage?qrCode=' //2.打开view文件夹根目录dashboard.vue 更换大屏项目发布的跳转地址,打开大屏项目config/index.js更改请求地址,大屏打包node<16.0.0; //3.只有南网项目产线gl发布打包时候需要注意: // 将 assetsDir:'static' 改为 assetsDir:'gl/static',还有env.development和env.production中的VUE_APP_BASE_API改为'/gl/dev-api';登录跳转地址从/login换成/gl/;