1
This commit is contained in:
70
admin/config/index.js
Normal file
70
admin/config/index.js
Normal file
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* Admin 前端配置文件
|
||||
* 支持多环境配置:开发环境、测试环境、生产环境
|
||||
*/
|
||||
|
||||
// 获取当前环境
|
||||
const env = process.env.NODE_ENV || 'development'
|
||||
|
||||
// 基础配置
|
||||
const baseConfig = {
|
||||
title: '找工作管理系统',
|
||||
// 是否显示设置按钮
|
||||
showSettings: true,
|
||||
// 是否显示标签栏
|
||||
showTagsView: true,
|
||||
// 是否固定头部
|
||||
fixedHeader: true,
|
||||
// 是否显示logo
|
||||
sidebarLogo: true,
|
||||
// token在Cookie中存储的天数,默认1天
|
||||
cookieExpires: 1,
|
||||
// 系统主题色
|
||||
themeColor: '#2d8cf0',
|
||||
}
|
||||
|
||||
// 开发环境配置
|
||||
const developmentConfig = {
|
||||
...baseConfig,
|
||||
apiUrl: 'http://localhost:9097/admin_api/',
|
||||
uploadUrl: 'http://localhost:9097/admin_api/upload',
|
||||
// 开发环境显示更多调试信息
|
||||
debug: true
|
||||
}
|
||||
|
||||
// 测试环境配置
|
||||
const testConfig = {
|
||||
...baseConfig,
|
||||
apiUrl: 'http://work.light120.com/admin_api/',
|
||||
uploadUrl: 'http://work.light120.com/admin_api/upload',
|
||||
debug: false
|
||||
}
|
||||
|
||||
// 生产环境配置
|
||||
const productionConfig = {
|
||||
...baseConfig,
|
||||
apiUrl: 'http://work.light120.com/admin_api/',
|
||||
uploadUrl: 'http://work.light120.com/admin_api/upload',
|
||||
debug: false
|
||||
}
|
||||
|
||||
// 根据环境导出对应配置
|
||||
const configMap = {
|
||||
development: developmentConfig,
|
||||
test: testConfig,
|
||||
production: productionConfig
|
||||
}
|
||||
|
||||
const config = configMap[env] || developmentConfig
|
||||
|
||||
// 导出配置
|
||||
export default config
|
||||
|
||||
// 也支持按需导出
|
||||
export {
|
||||
baseConfig,
|
||||
developmentConfig,
|
||||
testConfig,
|
||||
productionConfig
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user