feat: 运行环境区分

pull/16/head^2
TianYu 2023-06-08 12:26:38 +08:00
parent bc1ff1422e
commit 346e4036fd
5 changed files with 30 additions and 4 deletions

View File

@ -1,11 +1,11 @@
# 开发环境配置
ENV = 'development'
ENV = 'test'
# 页面标题
VUE_APP_TITLE = 创盈商户管理系统
# 创盈管理系统/本地环境
VUE_APP_BASE_API = 'http://api-dashboard.yudao.iocoder.cn'
VUE_APP_BASE_API = 'http://api.nnhwl.top'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -7,10 +7,11 @@
"scripts": {
"local": "vue-cli-service serve --mode local",
"dev": "vue-cli-service serve --mode dev",
"front": "vue-cli-service serve --mode front",
"test": "vue-cli-service serve --mode test",
"build:prod": "vue-cli-service build --mode prod",
"build:stage": "vue-cli-service build --mode stage",
"build:dev": "vue-cli-service build --mode dev",
"build:test": "vue-cli-service build --mode test",
"build:static": "vue-cli-service build --mode static",
"preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src",

View File

@ -3,7 +3,7 @@ module.exports = {
/**
* 推广链接域名
*/
spreadDomain: 'http://h5.cyywl.top',
spreadDomain: process.env.ENV === 'production' ? 'http://h5.cyywl.top' : 'http://h5.nnhwl.top',
/**
* 推广码生成访问H5链接地址

View File

@ -29,7 +29,15 @@ module.exports = {
//分页最多显示条数
LIMIT: 10,
// 推广链接域名
// #ifdef DEV
SPREAD_DOMAIN: 'http://h5.nnhwl.top',
// #endif
// #ifdef TEST
SPREAD_DOMAIN: 'http://h5.nnhwl.top',
// #endif
// #ifdef PROD
SPREAD_DOMAIN: 'http://h5.cyywl.top',
// #endif
// 推广码生成访问H5链接地址
SPREAD_LINK: '/pages/member_application/index',
};

View File

@ -22,6 +22,20 @@
"UNI_PLATFORM": "h5",
"isVConsole": true,
"APP_BASE_URL": "http://192.168.1.188:48080"
},
"define": {
"DEV": true
}
},
"test": {
"title": "测试版",
"env": {
"UNI_PLATFORM": "h5",
"isVConsole": true,
"APP_BASE_URL": "http://api.nnhwl.top"
},
"define": {
"TEST": true
}
},
"prod": {
@ -30,6 +44,9 @@
"UNI_PLATFORM": "h5",
"isVConsole": false,
"APP_BASE_URL": "http://api.cyywl.top"
},
"define": {
"PROD": true
}
}
}