zhizhi/modules/orders/config.js

23 lines
754 B
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.

/**
* config.js - 配置中心
* 所有可通过环境变量覆盖的配置
*/
export const CONFIG = {
port: parseInt(process.env.ZQ_PORT || '3920'),
deepseekKey: process.env.DEEPSEEK_API_KEY || 'sk-a9b69e9cd2dc4ca68d6aceaa84f22afb',
adminToken: process.env.ZQ_ADMIN_TOKEN || '', // 可选,管理面板简单鉴权
rateLimit: {
maxPerIp: parseInt(process.env.ZQ_RATE_LIMIT || '3'),
windowMinutes: 60,
},
siteName: process.env.ZQ_SITE_NAME || '之秋 · 技术开发接单',
};
export function validateConfig() {
const warnings = [];
if (!CONFIG.deepseekKey || CONFIG.deepseekKey === 'your-api-key-here') {
warnings.push('⚠️ DEEPSEEK_API_KEY 未设置AI 辅助录入功能将不可用');
}
return warnings;
}