diff --git a/.env.staging b/.env prd similarity index 63% rename from .env.staging rename to .env prd index f1e46bd7c..ec09127a7 100644 --- a/.env.staging +++ b/.env prd @@ -2,4 +2,6 @@ NODE_ENV = 'production' # flag -VUE_APP_FLAG='staging' \ No newline at end of file +VUE_APP_FLAG='prd' + + diff --git a/.env.production b/.env uat similarity index 60% rename from .env.production rename to .env uat index df8d320bd..f413997e5 100644 --- a/.env.production +++ b/.env uat @@ -2,6 +2,6 @@ NODE_ENV = 'production' # flag -VUE_APP_FLAG='production' +VUE_APP_FLAG='uat' diff --git a/.env.dat b/.env.dat new file mode 100644 index 000000000..1d0e63f47 --- /dev/null +++ b/.env.dat @@ -0,0 +1,5 @@ +# env +NODE_ENV = 'production' + +# flag +VUE_APP_FLAG='dat' \ No newline at end of file diff --git a/.env.development b/.env.dev similarity index 60% rename from .env.development rename to .env.dev index 0f3aa8d52..ca81bc09b 100644 --- a/.env.development +++ b/.env.dev @@ -2,6 +2,6 @@ NODE_ENV = 'development' # flag -VUE_APP_FLAG='development' +VUE_APP_FLAG='dev' diff --git a/.env.development-deploy b/.env.development-deploy deleted file mode 100644 index 1826e600b..000000000 --- a/.env.development-deploy +++ /dev/null @@ -1,7 +0,0 @@ -# env 用于前端dev环境发布。与.env.development的区别:NODE_ENV = production,开启代码压缩 -NODE_ENV = 'production' - -# flag -VUE_APP_FLAG='development' - - diff --git a/package.json b/package.json index e9e32fcaa..e36d8a63e 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,14 @@ "private": true, "scripts": { "serve": "vue-cli-service serve", - "build:dev": "vue-cli-service build --mode development-deploy", - "build:prod": "vue-cli-service build", - "build:stage": "vue-cli-service build --mode staging", + "build:dev": "vue-cli-service build --mode dev", + "build:prd": "vue-cli-service build --mode prd", + "build:uat": "vue-cli-service build --mode uat", + "build:dat": "vue-cli-service build --mode dat", + "dev": "vue-cli-service serve --mode dev", + "dat": "vue-cli-service serve --mode dat", + "uat": "vue-cli-service serve --mode uat", + "prd": "vue-cli-service serve --mode prd", "lint": "vue-cli-service lint", "lint:fix": "eslint --fix --ext .js,.vue src", "format": "prettier --config ./.prettierrc --write \"src/**/*.js\" \"src/**/*.vue\"", @@ -50,4 +55,4 @@ "sass-loader": "^7.1.0", "vue-template-compiler": "^2.6.10" } -} +} \ No newline at end of file diff --git a/src/config/index.js b/src/config/index.js index 6ddeb027a..c01fba5b5 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -10,7 +10,7 @@ let apiDomain, imgDomain, assetsUrl, mainUrl, payUrl // 保融支付的收银台 // 可以多个接口域名,按需添加 console.log('环境:', process.env.VUE_APP_FLAG) switch (process.env.VUE_APP_FLAG) { - case 'development': + case 'dev': // apiDomain = 'http://47.96.143.111:7000/api/v1' apiDomain = 'http://139.199.50.151:7000/api/v1' // 国富api // imgDomain = 'http://10.10.100.98:7012/updown' // dev @@ -21,15 +21,15 @@ switch (process.env.VUE_APP_FLAG) { mainUrl = 'http://139.199.50.151' payUrl = 'http://10.10.100.84:7003/s3-modules-gateway/embed/gateway.action' break - case 'staging': - apiDomain = 'http://47.96.143.111:7000/api/v1' - imgDomain = 'http://211.159.248.123:7001' + case 'uat': + apiDomain = '' + imgDomain = '' // 静态服务资源 - assetsUrl = 'http://47.96.143.111:8000/app/' + assetsUrl = '' mainUrl = '' - payUrl = 'http://10.10.100.84:7003/s3-modules-gateway/embed/gateway.action' + payUrl = '' break - case 'production': + case 'prd': apiDomain = 'https://iagentsales.e-guofu.com/api/v1' imgDomain = 'https://iagentsales-ud.e-guofu.com:8553/updown' // imgDomain = 'http://10.10.100.98:7012/updown' // 上生产前 @@ -39,6 +39,14 @@ switch (process.env.VUE_APP_FLAG) { mainUrl = 'https://iagentsales.e-guofu.com' payUrl = 'https://uns3.e-guofu.com/s3-modules-gateway/embed/gateway.action' break + case 'dat': + apiDomain = '' + imgDomain = '' + // 静态服务资源 + assetsUrl = '' + mainUrl = '' + payUrl = '' + break } /** * 配置文件 diff --git a/src/main.js b/src/main.js index bdcfd1a7d..0172d03f1 100644 --- a/src/main.js +++ b/src/main.js @@ -51,15 +51,21 @@ Vue.prototype.$jump = Jump Vue.prototype.$utils = utils //混合开发调试工具 -if (process.env.NODE_ENV == 'development') { - // let Eruda = require('eruda') - // Eruda.init() - Vue.prototype.$rootUrl = location.origin -} else if (process.env.NODE_ENV == 'production') { - Vue.prototype.$rootUrl = location.origin + '/ebiz-h5' +// if (process.env.NODE_ENV == 'development') { +// // let Eruda = require('eruda') +// // Eruda.init() +// Vue.prototype.$rootUrl = location.origin +// } else if (process.env.NODE_ENV == 'production') { +// Vue.prototype.$rootUrl = location.origin + '/ebiz-h5' +// } +if (process.env.VUE_APP_FLAG != 'prd') { + let Eruda = require('eruda') + Eruda.init() +} else { + // Vue.prototype.$rootUrl = location.origin + '/ebiz-h5' + Vue.config.devtools = true } -let Eruda = require('eruda') -Eruda.init() + // 注册过滤器 Object.keys(Filters).forEach(function(k) { Vue.filter(k, Filters[k])