feat: 初步支持 Gemini Business 并重构和整理

This commit is contained in:
foxhui
2025-11-28 17:53:48 +08:00
Unverified
parent 811e175054
commit 3a08ccadf4
18 changed files with 2590 additions and 1031 deletions
+4 -17
View File
@@ -1,18 +1,5 @@
import crypto from 'crypto';
import { generateApiKey } from './security/apiKey.js';
/**
* 生成随机 API Key
* 格式: sk- + 32位十六进制字符串
*/
function generateApiKey() {
const buffer = crypto.randomBytes(16);
const hex = buffer.toString('hex');
return `sk-${hex}`;
}
const key = generateApiKey();
console.log('\n=== API Key 生成器 ===');
console.log('您的新 API Key 是:');
console.log('\x1b[32m%s\x1b[0m', key); // 绿色高亮
console.log('\n请将其复制到 config.yaml 的 server.auth 字段中。');
console.log('======================\n');
console.log('>>> [GenAPIKey] 生成新的 API Key:');
console.log(generateApiKey());
console.log('\n>>> 请将此 Key 复制到 config.yaml 文件的 server.auth 字段中。');