Files
framework_project_web/admin/config/index.js
张成 dee3a336ce init
2026-04-29 13:34:39 +08:00

61 lines
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 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
}