init
This commit is contained in:
60
admin/config/index.js
Normal file
60
admin/config/index.js
Normal file
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* Admin 前端配置文件
|
||||
* 支持多环境:development、sit、prod
|
||||
* 打包时由 webpack DefinePlugin 注入 __APP_BUILD_ENV__(.env.sit / .env.prod)
|
||||
*/
|
||||
const buildEnv = (typeof __APP_BUILD_ENV__ !== 'undefined' ? __APP_BUILD_ENV__ : (typeof process !== 'undefined' && process.env && process.env.BUILD_ENV)) || (typeof process !== 'undefined' && process.env && process.env.NODE_ENV) || 'development'
|
||||
|
||||
// 基础配置
|
||||
const baseConfig = {
|
||||
title: '沁羿物流 · 仓库管理系统',
|
||||
showSettings: true,
|
||||
showTagsView: true,
|
||||
fixedHeader: true,
|
||||
sidebarLogo: true,
|
||||
cookieExpires: 1,
|
||||
themeColor: '#2d8cf0'
|
||||
}
|
||||
|
||||
// 开发环境
|
||||
const developmentConfig = {
|
||||
...baseConfig,
|
||||
apiUrl: 'http://localhost:9098/admin_api/',
|
||||
uploadUrl: 'http://localhost:9098/admin_api/upload',
|
||||
debug: true
|
||||
}
|
||||
|
||||
// SIT 环境(build:sit)- tennis 接口
|
||||
const sitConfig = {
|
||||
...baseConfig,
|
||||
apiUrl: 'http://*/admin_api/',
|
||||
uploadUrl: 'http://*/admin_api/upload',
|
||||
debug: false
|
||||
}
|
||||
|
||||
// 生产环境(build:prod)— 与线上 Node 同域
|
||||
const productionConfig = {
|
||||
...baseConfig,
|
||||
apiUrl: 'http://*/admin_api/',
|
||||
uploadUrl: 'http://*/admin_api/upload',
|
||||
debug: false
|
||||
}
|
||||
|
||||
const configMap = {
|
||||
development: developmentConfig,
|
||||
sit: sitConfig,
|
||||
production: productionConfig,
|
||||
prod: productionConfig
|
||||
}
|
||||
|
||||
const config = configMap[buildEnv] || developmentConfig
|
||||
|
||||
export default config
|
||||
|
||||
export {
|
||||
baseConfig,
|
||||
developmentConfig,
|
||||
sitConfig,
|
||||
productionConfig
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user