V 3.2.3
1.优化文案处理逻辑,重构界面 2.修复批量导出草稿只能导出一个的bug 3.添加自动 推理人物 场景 方便快速生成标签 4.(聚合推文) 修复删除数据bug 5.新增推理国内转发接口(包括翻译) 6.新增文案导入时导入SRT后可手动校验一遍时间数据,简化简单过程 7.语音服务那边添加字符不生效,格式化不生效 8.优化语音服务(数据结构优化,可设置合成超时时间)
This commit is contained in:
@@ -351,27 +351,59 @@ export class Translate {
|
||||
content: translateData
|
||||
})
|
||||
|
||||
let config = {
|
||||
method: 'post',
|
||||
maxBodyLength: Infinity,
|
||||
url: this.translationBusiness,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`
|
||||
},
|
||||
data: JSON.stringify(data)
|
||||
let content = ''
|
||||
// 判断整体是不是需要LMS转发
|
||||
if (global.config.useTransfer) {
|
||||
let url = define.lms + '/lms/Forward/SimpleTransfer'
|
||||
let config = {
|
||||
method: 'post',
|
||||
url: url,
|
||||
maxBodyLength: Infinity,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: JSON.stringify({
|
||||
url: this.translationBusiness,
|
||||
apiKey: token,
|
||||
dataString: JSON.stringify(data)
|
||||
})
|
||||
}
|
||||
// 重试机制
|
||||
let res = await RetryWithBackoff(
|
||||
async () => {
|
||||
return await axios.request(config)
|
||||
},
|
||||
5,
|
||||
2000
|
||||
)
|
||||
|
||||
if (res.data.code != 1) {
|
||||
throw new Error(res.data.message)
|
||||
}
|
||||
content = GetOpenAISuccessResponse(res.data.data)
|
||||
} else {
|
||||
let config = {
|
||||
method: 'post',
|
||||
maxBodyLength: Infinity,
|
||||
url: this.translationBusiness,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`
|
||||
},
|
||||
data: JSON.stringify(data)
|
||||
}
|
||||
let res = await RetryWithBackoff(
|
||||
async () => {
|
||||
return await axios.request(config)
|
||||
},
|
||||
5,
|
||||
2000
|
||||
)
|
||||
// 将返回的数据进行拼接数据处理
|
||||
content = GetOpenAISuccessResponse(res.data)
|
||||
}
|
||||
let res = await RetryWithBackoff(
|
||||
async () => {
|
||||
return await axios.request(config)
|
||||
},
|
||||
5,
|
||||
2000
|
||||
)
|
||||
// 将返回的数据进行拼接数据处理
|
||||
|
||||
let res_data = []
|
||||
let content = GetOpenAISuccessResponse(res.data)
|
||||
|
||||
if (to == 'zh') {
|
||||
res_data.push({
|
||||
|
||||
Reference in New Issue
Block a user