Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/bei123_text-to-speech-app.json
T
OpenCode 68a9071cf1 feat: reconcile local master with origin (exa/hot-platform hunters, leaks ledger, latest results)
Local branch had diverged from origin/master (sibling commits on the same base). Rewrote local history linearly on top of origin/master, folding in all local content: exa/hot-platform discovery hunters, leaks ledger, nightly sweep orchestrator, updated .gitignore and skill docs, plus the latest hunt output and vault state. Remote-only files (vault keys, channel scripts) were restored rather than dropped, so the resulting tree is a full union of both sides.
2026-08-07 12:53:47 +08:00

1 line
2.9 KiB
JSON

{"repo": "bei123/text-to-speech-app", "files": {"backend/controllers/aiController.js": {"9f587c2b1bcb179575ce1695c2271e82da68e811": {"t": 1786068264.1036513, "n": 2433, "h": "f064e4872c7bde54", "c": "const CryptoJS = require('crypto-js');\nconst axios = require('axios');\nconst { DEEPSEEK_API_KEY, DEEPSEEK_API_URL } = require('../utils/constants');\n\n// 调用DeepSeek API\nconst callDeepseek = async (req, res) => {\n try {\n let prompt, system = '';\n\n // 检查是否有加密数据\n if (req.body.encryptedData && req.body.key) {\n try {\n // 解密数据\n const bytes = CryptoJS.AES.decrypt(req.body.encryptedData, req.body.key);\n const decryptedData = JSON.parse(bytes.toString(CryptoJS.enc.Utf8));\n\n // 从解密后的数据中提取参数\n prompt = decryptedData.prompt;\n system = decryptedData.system || '';\n } catch (decryptError) {\n console.error('解密请求数据失败:', decryptError);\n return res.status(400).json({ message: '解密请求数据失败' });\n }\n } else {\n // 兼容未加密的请求\n prompt = req.body.prompt;\n system = req.body.system || '';\n }\n\n // 验证必要参数\n if (!prompt) {\n return res.status(400).json({ message: '缺少必要参数' });\n }\n\n const headers = {\n Authorization: `Bearer ${DEEPSEEK_API_KEY}`,\n 'Content-Type': 'application/json',\n };\n\n const payload = {\n messages: [\n { role: 'system', content: system },\n { role: 'user', content: prompt },\n ],\n model: \"deepseek-v4-pro\",\n max_tokens: 8192,\n thinking: { type: 'enabled' },\n reasoning_effort: 'high',\n stream: false,\n };\n\n const response = await axios.post(DEEPSEEK_API_URL, payload, { headers });\n\n // 获取 API 返回的文本\n let text = response.data.choices[0].message.content;\n\n // 保留中文、英文、数字、空格和常用标点符号,移除其他特殊字符\n text = text.replace(/[^\\w\\s\\u4e00-\\u9fa5,.!?,。!?]/g, ''); // 保留中英文、数字、空格和常用标点符号\n\n // 如果请求是加密的,则响应也需要加密\n if (req.body.encryptedData && req.body.key) {\n const encryptedText = CryptoJS.AES.encrypt(JSON.stringify({ text }), req.body.key).toString();\n res.json({ encryptedData: encryptedText });\n } else {\n res.json({ text });\n }\n } catch (error) {\n console.error('调用 DeepSeek API 失败:', error.response?.data || error.message);\n res.status(500).json({ error: '调用 DeepSeek API 失败' });\n }\n};\n\nmodule.exports = {\n callDeepseek\n}; "}}}}