Compare commits
	
		
			2 Commits
		
	
	
		
			2ef1f80014
			...
			e6a446e39f
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| e6a446e39f | |||
| f928bdd39d | 
| @ -107,9 +107,9 @@ class TranslateService { | ||||
|         // 检查并修复translateRoute为空的情况 | ||||
|         if (!configById.translateRoute || configById.translateRoute === 'null') { | ||||
|           console.log('用户配置translateRoute为空,正在修复...'); | ||||
|           await app.sdb.update('translate_config', { translateRoute: 'deepl' }, { userId: userId }); | ||||
|           configById.translateRoute = 'deepl'; | ||||
|           console.log('已修复用户配置translateRoute为deepl'); | ||||
|           await app.sdb.update('translate_config', { translateRoute: 'youDao' }, { userId: userId }); | ||||
|           configById.translateRoute = 'youDao'; | ||||
|           console.log('已修复用户配置translateRoute为youDao'); | ||||
|         } | ||||
|         return { status: true, message: '查询成功', data: configById } | ||||
|       } else { | ||||
| @ -119,9 +119,9 @@ class TranslateService { | ||||
|           // 检查并修复translateRoute为空的情况 | ||||
|           if (!config.translateRoute || config.translateRoute === 'null') { | ||||
|             console.log('平台配置translateRoute为空,正在修复...'); | ||||
|             await app.sdb.update('translate_config', { translateRoute: 'deepl' }, { platform: platform }); | ||||
|             config.translateRoute = 'deepl'; | ||||
|             console.log('已修复平台配置translateRoute为deepl'); | ||||
|             await app.sdb.update('translate_config', { translateRoute: 'youDao' }, { platform: platform }); | ||||
|             config.translateRoute = 'youDao'; | ||||
|             console.log('已修复平台配置translateRoute为youDao'); | ||||
|           } | ||||
|           return { status: true, message: '查询成功', data: config } | ||||
|         } else { | ||||
| @ -156,8 +156,8 @@ class TranslateService { | ||||
|         const res = await get(url, {}, { timeout: 30000 }) | ||||
|         const code = res.data.code | ||||
|         const data1 = res.data.data | ||||
|         let defaultTranslateRoute = 'deepl' | ||||
|         let defaultHistoryTranslateRoute = 'deepseek' | ||||
|         let defaultTranslateRoute = 'youDao' | ||||
|         let defaultHistoryTranslateRoute = 'youDao' | ||||
|         if (code === 2000) { | ||||
|           const { real_time_route, history_route } = data1 | ||||
|           defaultTranslateRoute = real_time_route | ||||
| @ -192,9 +192,9 @@ class TranslateService { | ||||
|       // 检查并修复translateRoute为空的情况 | ||||
|       if (data && (!data.translateRoute || data.translateRoute === 'null')) { | ||||
|         console.log('配置存在但translateRoute为空,正在修复...'); | ||||
|         await app.sdb.update('translate_config', { translateRoute: 'deepl' }, { platform: platform }); | ||||
|         data.translateRoute = 'deepl'; | ||||
|         console.log('已修复translateRoute为deepl'); | ||||
|         await app.sdb.update('translate_config', { translateRoute: 'youDao' }, { platform: platform }); | ||||
|         data.translateRoute = 'youDao'; | ||||
|         console.log('已修复translateRoute为youDao'); | ||||
|       } | ||||
|  | ||||
|       return { status: true, message: '查询成功2', data: data } | ||||
| @ -907,8 +907,8 @@ class TranslateService { | ||||
|     const res = await get(url, {}, { timeout: 30000 }) | ||||
|     const code = res.data.code | ||||
|     const data1 = res.data.data | ||||
|     let defaultTranslateRoute = 'deepl' | ||||
|     let defaultHistoryTranslateRoute = 'deepseek' | ||||
|     let defaultTranslateRoute = 'youDao' | ||||
|     let defaultHistoryTranslateRoute = 'youDao' | ||||
|     if (code === 2000) { | ||||
|       const { real_time_route, history_route } = data1 | ||||
|       defaultTranslateRoute = real_time_route | ||||
| @ -951,24 +951,13 @@ class TranslateService { | ||||
|       } else { | ||||
|         // 使用默认翻译线路配置 | ||||
|         translationRoute = [ | ||||
|           { | ||||
|             name: "deepl", | ||||
|             zhName: "DeepL翻译", | ||||
|             enName: "DeepL Translate", | ||||
|             otherArgs: `{"apiUrl": "https://api-free.deepl.com/v2/translate","apiKey": "","secretKey": ""}`, | ||||
|             enable: 1 | ||||
|           }, | ||||
|           { | ||||
|             name: "deepseek", | ||||
|             zhName: "DeepSeek翻译", | ||||
|             enName: "DeepSeek Translate", | ||||
|             otherArgs: `{"apiUrl": "https://api.deepseek.com/api/v1/translate","apiKey": "","secretKey": ""}`, | ||||
|             enable: 1 | ||||
|           }, | ||||
|           { | ||||
|             name: "youDao", | ||||
|             zhName: "有道翻译", | ||||
|             enName: "Youdao Translate", | ||||
|             otherArgs: `{"apiUrl": "https://openapi.youdao.com/api","apiKey": "","secretKey": ""}`, | ||||
|             enable: 1 | ||||
|           }, | ||||
|             otherArgs: `{"apiUrl": "https://openapi.youdao.com/api","appId": "","apiKey": ""}`, | ||||
|             enable: 1 | ||||
|           }, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	