This commit is contained in:
2026-01-18 15:27:43 +08:00
parent a0378b5cbd
commit 567e77cd87
14 changed files with 358 additions and 620 deletions

View File

@@ -1,38 +1,27 @@
/**
* 应用层 API 服务
* 封装应用特定的 API 调用,使用 mono 级别的服务
*/
import { fetchEventSource } from '@microsoft/fetch-event-source'
// 直接使用实例(最简单、最可靠)
import tokenManager from '@gold/utils/token-manager'
import { TikHubService } from '@gold/api/services'
import BaiLianService from './bailian'
import { API_BASE } from '@gold/config/api'
/**
* TikHub API 基础路径
*/
// 百炼API基础路径
const TIKHUB_BASE = API_BASE.TIKHUB_APP || API_BASE.TIKHUB || ''
/**
* 应用层通用服务
*/
// 应用层通用服务
export const CommonService = {
/**
* 视频转字符(音频转文字)
* 直接使用 mono 级别的 TikHub 服务
*/
videoToCharacters(data) {
return TikHubService.videoToCharacters(data)
return BaiLianService.videoToCharacters(data)
},
/**
* 调用工作流
*/
callWorkflow(data) {
return TikHubService.callWorkflow(data)
return BaiLianService.callWorkflow(data)
},
/**
* 流式调用工作流SSE
*/
@@ -49,7 +38,7 @@ export const CommonService = {
let retryCount = 0
const maxRetries = 0
return fetchEventSource(`${TIKHUB_BASE}/callWorkflow`, {
method: 'post',
headers: {
@@ -81,5 +70,3 @@ export const CommonService = {
}
export default CommonService