更新安全配置项目
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
import OpenAI from "openai";
|
||||
import {getConfig} from "@/lib/config";
|
||||
import {getAIConfig} from "@/lib/config";
|
||||
|
||||
function parseTranslation(content: string): string | null {
|
||||
// 第一步:清理内容,移除 Markdown 代码块、换行、多余空格
|
||||
@@ -21,7 +21,7 @@ function parseTranslation(content: string): string | null {
|
||||
// 翻译单个词组(带重试)
|
||||
export async function translateWithAI(word: string): Promise<string | null> {
|
||||
// 获取配置
|
||||
const aiConfig = getConfig().ai
|
||||
const aiConfig = getAIConfig()
|
||||
|
||||
if (!aiConfig.apiKey) {
|
||||
throw new Error("AI API Key 未配置");
|
||||
|
||||
Reference in New Issue
Block a user