From 295dd8606811e1bfcba4aab8ae46750b3b63d8f9 Mon Sep 17 00:00:00 2001 From: chenran Date: Wed, 7 Jun 2023 17:44:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.developmentLocal | 19 +++++++++++++++++++ .env.prod | 21 +++++++++++++++++++++ .env.prodLocal | 21 +++++++++++++++++++++ .env.production | 2 +- .env.test | 2 +- package.json | 3 +++ src/bootstrap.ts | 4 ++-- src/models/index.ts | 2 +- src/router/index.ts | 4 ++-- src/utils/player.ts | 2 +- src/views/base.component.ts | 5 +++-- src/views/overview.component.ts | 2 +- vue.config.js | 3 +++ 14 files changed, 80 insertions(+), 12 deletions(-) create mode 100644 .env.developmentLocal create mode 100644 .env.prod create mode 100644 .env.prodLocal diff --git a/.env.development b/.env.development index a0ddf67..6575f6d 100644 --- a/.env.development +++ b/.env.development @@ -6,7 +6,7 @@ VUE_APP_TITLE = 汉邦唐消防训练基地 # 网关地址 VUE_APP_GATEWAY_URL="/dev-api" # UE4服务地址 -VUE_APP_PALYER_URL="192.168.1.66:8080" +VUE_APP_PALYER_URL="172.16.0.77:8080" # 服务地址 VUE_APP_BASE_API_URL="http://192.168.2.3:8081" # 服务前-- 请严格遵守格式 不允许换行 diff --git a/.env.developmentLocal b/.env.developmentLocal new file mode 100644 index 0000000..a52d8a9 --- /dev/null +++ b/.env.developmentLocal @@ -0,0 +1,19 @@ + +#开发环境 +NODE_ENV:"development" +# 页面标题 +VUE_APP_TITLE = 汉邦唐消防训练基地 +# 网关地址 +VUE_APP_GATEWAY_URL="/dev-api" +# UE4服务地址 +VUE_APP_PALYER_URL="192.168.1.66:8080" +# 服务地址 +VUE_APP_BASE_API_URL="http://192.168.2.3:8081" +# 服务前-- 请严格遵守格式 不允许换行 +VUE_APP_SERVICE_PREFIX= '{"knowledge":"/knowledge","system":"/system"}' +# 是否显示全部菜单 +VUE_APP_ALL_MENU = false +# 微前端地址 +VUE_APP_REMOTES_URL="http://119.45.158.12/common/" +# 当前应用部署地址 +VUE_APP_EXPOSES_URL="http://192.168.1.66:8084/" \ No newline at end of file diff --git a/.env.prod b/.env.prod new file mode 100644 index 0000000..2d8ac12 --- /dev/null +++ b/.env.prod @@ -0,0 +1,21 @@ + +#开发环境 +NODE_ENV:"development" +# 页面标题 +VUE_APP_TITLE = 汉邦唐消防训练基地 +# 网关地址 +VUE_APP_GATEWAY_URL="/dev-api" +# UE4服务地址 +VUE_APP_PALYER_URL="172.16.0.77:8080" +# 服务地址 +VUE_APP_BASE_API_URL="http://192.168.2.3:8081" +# 服务前-- 请严格遵守格式 不允许换行 +VUE_APP_SERVICE_PREFIX= '{"knowledge":"/knowledge","system":"/system"}' +# 是否显示全部菜单 +VUE_APP_ALL_MENU = false +# 微前端地址 +VUE_APP_REMOTES_URL="http://119.45.158.12/common/" +# 当前应用部署地址 +VUE_APP_EXPOSES_URL="" +# nginx路径 +PUB_PATH:'/trainingbase/' \ No newline at end of file diff --git a/.env.prodLocal b/.env.prodLocal new file mode 100644 index 0000000..ec978fe --- /dev/null +++ b/.env.prodLocal @@ -0,0 +1,21 @@ + +#开发环境 +NODE_ENV:"production" +# 页面标题 +VUE_APP_TITLE = 汉邦唐消防训练基地 +# 网关地址 +VUE_APP_GATEWAY_URL="/dev-api" +# UE4服务地址 +VUE_APP_PALYER_URL="192.168.1.66:8080" +# 服务地址 +VUE_APP_BASE_API_URL="http://192.168.2.3:8081" +# 服务前-- 请严格遵守格式 不允许换行 +VUE_APP_SERVICE_PREFIX= '{"knowledge":"/knowledge","system":"/system"}' +# 是否显示全部菜单 +VUE_APP_ALL_MENU = false +# 微前端地址 +VUE_APP_REMOTES_URL="http://119.45.158.12/common/" +# 当前应用部署地址 +VUE_APP_EXPOSES_URL="http://192.168.1.66:8084/" +# nginx路径 +PUB_PATH:'/dev/trainingbase/' diff --git a/.env.production b/.env.production index 5131da7..8f44ce3 100644 --- a/.env.production +++ b/.env.production @@ -6,7 +6,7 @@ VUE_APP_TITLE = 汉邦唐消防训练基地 # 网关地址 VUE_APP_GATEWAY_URL="/dev-api" # UE4服务地址 -VUE_APP_PALYER_URL="192.168.1.66:8080" +VUE_APP_PALYER_URL="172.16.0.77:8080" # 服务地址 VUE_APP_BASE_API_URL="http://192.168.2.3:8081" # 服务前-- 请严格遵守格式 不允许换行 diff --git a/.env.test b/.env.test index a0ddf67..6575f6d 100644 --- a/.env.test +++ b/.env.test @@ -6,7 +6,7 @@ VUE_APP_TITLE = 汉邦唐消防训练基地 # 网关地址 VUE_APP_GATEWAY_URL="/dev-api" # UE4服务地址 -VUE_APP_PALYER_URL="192.168.1.66:8080" +VUE_APP_PALYER_URL="172.16.0.77:8080" # 服务地址 VUE_APP_BASE_API_URL="http://192.168.2.3:8081" # 服务前-- 请严格遵守格式 不允许换行 diff --git a/package.json b/package.json index a6a0cc0..16ad848 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,10 @@ "private": true, "scripts": { "serve": "vue-cli-service serve --mode development", + "local": "vue-cli-service serve --mode developmentLocal --port 8084", "build": "vue-cli-service build --mode production", + "buildProdLocal": "vue-cli-service build --mode prodLocal", + "buildProd": "vue-cli-service build --mode prod", "test": "vue-cli-service build --mode test", "lint": "vue-cli-service lint" }, diff --git a/src/bootstrap.ts b/src/bootstrap.ts index 23860ce..abedcc5 100644 --- a/src/bootstrap.ts +++ b/src/bootstrap.ts @@ -4,8 +4,8 @@ import router from './router' import store from './store' import ElementUI from 'element-ui'; import 'element-ui/lib/theme-chalk/index.css'; -import SvgComponent from "hbt-common/components/common/svg.component.vue" -import EchartsComponent from "hbt-common/components/common/echarts.component.vue" +import SvgComponent from "hbt-common/components/svg.component.vue" +import EchartsComponent from "hbt-common/components/echarts.component.vue" import "@/assets/common/icons"; import 'animate.css'; import Mock from "mockjs" diff --git a/src/models/index.ts b/src/models/index.ts index 9d26629..d5dcabd 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -6,7 +6,7 @@ interface ActionResult { /** * message: 错误消息 */ - msg: string; + message: string; /** * data: 数据 */ diff --git a/src/router/index.ts b/src/router/index.ts index a5aba6a..556efcc 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -11,10 +11,10 @@ const routes: Array = [ { path: '/', name: 'index', - redirect:"/wit-park", + redirect:"/home", }, { - path: '/wit-park', + path: '/home', name: 'indexComponent', component:OverviewComponent }, diff --git a/src/utils/player.ts b/src/utils/player.ts index 8b5ea58..e7c12f2 100644 --- a/src/utils/player.ts +++ b/src/utils/player.ts @@ -17,7 +17,7 @@ export default class PlayerUtils{ }, ui:{ startupInfo:false, - mainUI:true + mainUI:false }, events: { diff --git a/src/views/base.component.ts b/src/views/base.component.ts index ad3e41a..ca72125 100644 --- a/src/views/base.component.ts +++ b/src/views/base.component.ts @@ -151,8 +151,9 @@ export default class BaseComponent extends Vue { if(!layer.ids.length){ const options = layer.data.map((item,index)=>{ const option = {} as any - if(item.hasPop){ - option.popupURL = "http://192.168.1.20:8081/#/popup?"+new URLSearchParams(layer.popData) + if(item.hasPop && !item.model){ + const path = process.env.NODE_ENV === 'production'? process.env.PUB_PATH : '/' + option.popupURL = "http://192.168.1.66"+path+"#/popup?"+new URLSearchParams(layer.popData) } return Object.assign(option,{ id:item.id, diff --git a/src/views/overview.component.ts b/src/views/overview.component.ts index a30eb74..79478bb 100644 --- a/src/views/overview.component.ts +++ b/src/views/overview.component.ts @@ -108,7 +108,7 @@ export default class OverViewComponent extends BaseComponent { this.emitCarPop(currentData) } if(data.GroupID==="video"){ - this.openVideo(currentData) + // this.openVideo(currentData) } } } diff --git a/vue.config.js b/vue.config.js index bdee74b..801bea3 100644 --- a/vue.config.js +++ b/vue.config.js @@ -6,6 +6,9 @@ const resolve = (dir)=>{ return path.join(__dirname, dir) } module.exports = defineConfig({ + publicPath: process.env.NODE_ENV === 'production' + ? process.env.PUB_PATH + : './', productionSourceMap:process.env.NODE_ENV!=="production", transpileDependencies: true, lintOnSave: true, // 在保存时校验格式