From f18e59fd52a43b658c223c63da0a6d938fb2459e Mon Sep 17 00:00:00 2001 From: zhaohongyu Date: Mon, 28 Apr 2025 13:54:39 +0800 Subject: [PATCH] =?UTF-8?q?2025/04/28=20=E5=9C=B0=E5=9B=BE=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/index.js | 10 +++++++++- src/views/map/index.vue | 20 ++++++++------------ static/config.js | 4 ++-- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/config/index.js b/config/index.js index eb65708..9ed5f13 100644 --- a/config/index.js +++ b/config/index.js @@ -11,7 +11,7 @@ module.exports = { assetsPublicPath: '/', proxyTable: { '/api': { - target: 'http://192.168.0.49:8091/', + target: 'http://192.168.192.201:8991/', changeOrigin: true, pathRewrite: { '^/api': '' @@ -23,6 +23,14 @@ module.exports = { pathRewrite: { '^/mapapi/': '' } + }, + '/file': { + target: 'http://192.168.192.201:8991/file/', + secure: true, + changeOrigin: true, + pathRewrite: { + '^/file': '' + } } }, diff --git a/src/views/map/index.vue b/src/views/map/index.vue index 962afab..46041f2 100644 --- a/src/views/map/index.vue +++ b/src/views/map/index.vue @@ -1133,11 +1133,8 @@ export default { peopleTrajectoryValue: '' } }, - created() { - this.initUser() - }, mounted() { - this.initCorpInfo() + this.initUser() this.pointBoxCfd = loadMapBoxCfd() this.pointBox = loadMapBox() }, @@ -2929,24 +2926,23 @@ export default { this.corpInfo.CORP_INFO_ID = data.info.CORP_INFO_ID this.corpInfo.latitude = data.info.latitude this.corpInfo.longitude = data.info.longitude - this.initUser() + // this.initUser() this.initMap() }).catch((e) => { console.log(e) }) }, - initUser() { + async initUser() { const { userId } = this.$route.query if (!userId) return - requestFN( - '/admin/v2/login', - { userId } - ).then((res) => { + try { + const res = await requestFN('/admin/v2/login', { userId }) console.log(res) - }).catch((e) => { + await this.initCorpInfo() + } catch (e) { alert('登录失败') window.close() - }) + } } } } diff --git a/static/config.js b/static/config.js index 432e69f..6b362d3 100644 --- a/static/config.js +++ b/static/config.js @@ -1,11 +1,11 @@ // eslint-disable-next-line no-unused-vars const config = { weburl: 'http://192.168.8.124:8080/', // 前台地址 - httpurl: 'http://192.168.8.124:8091/', // 后台地址 + httpurl: '/api', // 后台地址 qyurl: 'https://qgqy.qhdsafety.com/', // 企业前台 adminurl: 'https://www.qdkjchina.com/qa-prevention-admin/', // 正式 - fileUrl: 'https://wwag.qhdsafety.com/file/', // 附件服务器地址 + fileUrl: '/file', // 附件服务器地址 weburlWaiwang: 'https://qgqy.qhdsafety.com/', // 服务器外网地址 httpurlWaiwang: 'https://qgqy.qhdsafety.com/qa-prevention-gwj/', // , fileUrlWaiwang: 'https://qgqy.qhdsafety.com/file/', // 服务器外网 附件地址,