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,