Commit 02616cf2 by liangjianmin

chore(api): 优化环境配置输出日志格式

- 将环境日志从彩色样式改为文本与图标结合,提升识别度
- 调整环境变量默认值为开发环境以方便测试
- 清理冗余代码,简化环境判断逻辑
- 统一环境日志输出格式,增强可读性
parent c32bac54
Showing with 4 additions and 7 deletions
// 环境配置:'production' 正式环境 | 'development' 测试环境
const ENV = 'production';
const ENV = 'development';
// 环境配置映射
var ENV_CONFIG = {
......@@ -24,12 +24,9 @@ const API_BASE_PUR = currentEnv.API_BASE_PUR; //采购系统
const API_BASE = currentEnv.API_BASE; //WMS系统
const API_BASE_OSS = currentEnv.API_BASE_OSS; //oss系统
// 环境日志 - 带颜色突出显示
if (ENV === 'production') {
console.log('%c[环境] 当前运行环境:正式环境', 'color: #fff; background: #f56c6c; padding: 4px 8px; border-radius: 4px; font-weight: bold;');
} else {
console.log('%c[环境] 当前运行环境:测试环境', 'color: #fff; background: #67c23a; padding: 4px 8px; border-radius: 4px; font-weight: bold;');
}
// 环境日志输出
var envText = ENV === 'production' ? '🔴 正式环境' : '🟢 测试环境';
console.log(`[环境] ${envText}`);
const API = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment