From 52d3afd690985b3140f31e073b3e1d24be997800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Mon, 29 Jan 2024 14:41:24 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BF=AE=E6=94=B9bug81427=EF=BC=9B?= =?UTF-8?q?=E6=8A=8A=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E5=8D=95=E7=8B=AC?= =?UTF-8?q?=E6=8F=90=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 1 + .env.development | 1 + .env.production | 1 + .env.test | 1 + package.json | 3 ++- public/dev_api_config.js | 5 +++++ public/index.html | 22 ++++++++-------------- public/prod_api_config.js | 5 +++++ public/test_api_config.js | 5 +++++ src/config/index.js | 6 +++--- 10 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 .env create mode 100644 .env.development create mode 100644 .env.production create mode 100644 .env.test create mode 100644 public/dev_api_config.js create mode 100644 public/prod_api_config.js create mode 100644 public/test_api_config.js diff --git a/.env b/.env new file mode 100644 index 0000000..cbde1cc --- /dev/null +++ b/.env @@ -0,0 +1 @@ +NODE_ENV=production diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..c0d6652 --- /dev/null +++ b/.env.development @@ -0,0 +1 @@ +NODE_ENV=development diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..cbde1cc --- /dev/null +++ b/.env.production @@ -0,0 +1 @@ +NODE_ENV=production diff --git a/.env.test b/.env.test new file mode 100644 index 0000000..2c87534 --- /dev/null +++ b/.env.test @@ -0,0 +1 @@ +NODE_ENV=test diff --git a/package.json b/package.json index 62e8896..f1994dd 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "private": true, "scripts": { "serve": "vue-cli-service serve", - "build": "vue-cli-service build" + "build": "vue-cli-service build", + "build:test": "vue-cli-service build --mode test" }, "dependencies": { "ant-design-vue": "^1.7.5", diff --git a/public/dev_api_config.js b/public/dev_api_config.js new file mode 100644 index 0000000..7d007c0 --- /dev/null +++ b/public/dev_api_config.js @@ -0,0 +1,5 @@ +window._CONFIG = {} +// 后端地址 +window._CONFIG.interfaceUrl = 'http://10.0.1.19:8184' +// 后端地址 +window._CONFIG.downloadUrl = 'http://10.0.1.19:8184' diff --git a/public/index.html b/public/index.html index dda7f77..abc918d 100644 --- a/public/index.html +++ b/public/index.html @@ -10,23 +10,17 @@ + <% if (process.env.NODE_ENV === 'development' ) { %> - + <% } %> + <% if (process.env.NODE_ENV === 'production' ) { %> - + + <% } %> + + <% if (process.env.NODE_ENV === 'test' ) { %> + <% } %> diff --git a/public/prod_api_config.js b/public/prod_api_config.js new file mode 100644 index 0000000..2a91955 --- /dev/null +++ b/public/prod_api_config.js @@ -0,0 +1,5 @@ +window._CONFIG = {} +// 后端地址 +window._CONFIG.interfaceUrl = 'http://laws.sinotruk.com' +// 后端地址 +window._CONFIG.downloadUrl = 'http://laws-sinotruk-server-kmc2c.yf-grp:8080' diff --git a/public/test_api_config.js b/public/test_api_config.js new file mode 100644 index 0000000..9029c59 --- /dev/null +++ b/public/test_api_config.js @@ -0,0 +1,5 @@ +window._CONFIG = {} +// 后端地址 +window._CONFIG.interfaceUrl = 'http://10.10.10.46:9901' +// 后端地址 +window._CONFIG.downloadUrl = 'http://10.10.10.46:9901' diff --git a/src/config/index.js b/src/config/index.js index 739ab6b..90a57da 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -6,10 +6,10 @@ const interfaceUrl = window._CONFIG.interfaceUrl + '/laws-sinotruk/' //本地 // const interfaceUrl = 'https://srms.foton.com.cn/api/' //线上 -const uploadFilePath = '/laws-sinotruk/onlyoffice/upload' // 上传文件地址 -const downloadFilePath = window._CONFIG.downloadUrl + '/laws-sinotruk/onlyoffice/downLoadFile' // 下载文件地址 +const uploadFilePath = '/laws-sinotruk/onlyOffice/upload' // 上传文件地址 +const downloadFilePath = window._CONFIG.downloadUrl + '/laws-sinotruk/onlyOffice/downLoadFile' // 下载文件地址 -const staticFilePath = window._CONFIG.interfaceUrl + '/laws-sinotruk/onlyoffice/downLoadFile' //本地 +const staticFilePath = window._CONFIG.interfaceUrl + '/laws-sinotruk/onlyOffice/downLoadFile' //本地 // const staticFilePath = 'https://srms.foton.com.cn/api/att/attFile/downloadFile' //线上 module.exports = { interfaceUrl,