删除部分重要信息的日志输出
This commit is contained in:
+19
-19
@@ -236,10 +236,10 @@ const getCurrentEnvironment = (): string => {
|
||||
if (typeof window === 'undefined') {
|
||||
// 服务器端:直接使用process.env.NODE_ENV
|
||||
const nodeEnv = process.env.NODE_ENV;
|
||||
console.log('🔧 服务器端环境检测:', {
|
||||
NODE_ENV: nodeEnv,
|
||||
result: nodeEnv || 'development'
|
||||
});
|
||||
// console.log('🔧 服务器端环境检测:', {
|
||||
// NODE_ENV: nodeEnv,
|
||||
// result: nodeEnv || 'development'
|
||||
// });
|
||||
return nodeEnv || 'development';
|
||||
}
|
||||
|
||||
@@ -248,11 +248,11 @@ const getCurrentEnvironment = (): string => {
|
||||
const nodeEnv = process.env.NODE_ENV;
|
||||
const result = nextPublicNodeEnv || nodeEnv || 'development';
|
||||
|
||||
console.log('🔧 客户端环境检测:', {
|
||||
NEXT_PUBLIC_NODE_ENV: nextPublicNodeEnv,
|
||||
NODE_ENV: nodeEnv,
|
||||
result: result
|
||||
});
|
||||
// console.log('🔧 客户端环境检测:', {
|
||||
// NEXT_PUBLIC_NODE_ENV: nextPublicNodeEnv,
|
||||
// NODE_ENV: nodeEnv,
|
||||
// result: result
|
||||
// });
|
||||
|
||||
return result;
|
||||
};
|
||||
@@ -295,7 +295,7 @@ const getCurrentPort = (): string => {
|
||||
if (typeof window === 'undefined') {
|
||||
const runtimePort = getRuntimePort();
|
||||
if (runtimePort) {
|
||||
console.log('🔧 服务器端运行时端口检测:', runtimePort);
|
||||
// console.log('🔧 服务器端运行时端口检测:', runtimePort);
|
||||
return runtimePort;
|
||||
}
|
||||
}
|
||||
@@ -353,12 +353,12 @@ const getCurrentConfig = (): ApiConfig => {
|
||||
const env = getCurrentEnvironment();
|
||||
const port = getCurrentPort();
|
||||
|
||||
console.log('🔧 配置调试信息:', {
|
||||
environment: env,
|
||||
port: port,
|
||||
hasPortConfig: !!(port && portConfigs[port]),
|
||||
portConfig: port ? portConfigs[port] : null
|
||||
});
|
||||
// console.log('🔧 配置调试信息:', {
|
||||
// environment: env,
|
||||
// port: port,
|
||||
// hasPortConfig: !!(port && portConfigs[port]),
|
||||
// portConfig: port ? portConfigs[port] : null
|
||||
// });
|
||||
|
||||
// 获取基础配置
|
||||
let defaultConfig = configs[env] || configs.development;
|
||||
@@ -375,9 +375,9 @@ const getCurrentConfig = (): ApiConfig => {
|
||||
? { ...defaultConfig.oauth, ...portConfig.oauth }
|
||||
: defaultConfig.oauth
|
||||
};
|
||||
console.log(`🔧 使用端口特定配置---深度合并后: ${JSON.stringify(defaultConfig.oauth)}`)
|
||||
// console.log(`🔧 使用端口特定配置---深度合并后: ${JSON.stringify(defaultConfig.oauth)}`)
|
||||
} else {
|
||||
console.log(`🔧 使用环境配置: ${env}`, defaultConfig);
|
||||
// console.log(`🔧 使用环境配置: ${env}`, defaultConfig);
|
||||
}
|
||||
|
||||
// 只有在明确设置了环境变量的情况下才覆盖配置
|
||||
@@ -386,7 +386,7 @@ const getCurrentConfig = (): ApiConfig => {
|
||||
process.env.NEXT_PUBLIC_UPLOAD_URL;
|
||||
|
||||
if (hasEnvOverrides) {
|
||||
console.log('🔧 检测到环境变量覆盖,使用环境变量配置');
|
||||
// console.log('🔧 检测到环境变量覆盖,使用环境变量配置');
|
||||
return getConfigFromEnv(defaultConfig);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user