Compare commits
No commits in common. "eb8cab3f5af811f5b9e6a12b777262e3464f0cf1" and "b17aec4a1a5c08acb78433b1fd391e42c2733bb7" have entirely different histories.
eb8cab3f5a
...
b17aec4a1a
|
|
@ -580,18 +580,12 @@ export default {
|
|||
el.scrollTop = el.scrollHeight
|
||||
},
|
||||
|
||||
taskRowResultTrim(row) {
|
||||
return String(row?.result ?? '').trim()
|
||||
},
|
||||
|
||||
taskStatusText(row) {
|
||||
// 与后端约定:0 执行中,2 失败,1+http(s) 成功,1 且非 http 为生成失败
|
||||
if (row.status === 2) return '已失败/已取消'
|
||||
if (row.status === 0) return '执行中'
|
||||
if (row.status === 1) {
|
||||
const r = this.taskRowResultTrim(row)
|
||||
if (!r) return '失败'
|
||||
if (this.isHttpOrHttpsUrl(r)) return '已完成'
|
||||
if (/^cgt/i.test(r)) return '任务执行中'
|
||||
if (row.result && this.isHttpOrHttpsUrl(row.result)) return '已完成'
|
||||
return '任务生成失败'
|
||||
}
|
||||
return '执行中'
|
||||
|
|
@ -599,19 +593,12 @@ export default {
|
|||
|
||||
/** 是否展示完整「结果区」(视频 / 链接);其余状态仅紧凑展示在用户行右侧 */
|
||||
isChatRowSuccessWithMedia(row) {
|
||||
const r = this.taskRowResultTrim(row)
|
||||
return row.status === 1 && !!r && this.isHttpOrHttpsUrl(r)
|
||||
return row.status === 1 && row.result && this.isHttpOrHttpsUrl(row.result)
|
||||
},
|
||||
|
||||
chatRowInlineStatusClass(row) {
|
||||
if (row.status === 2) return 'vg-chat-inline-status--failed'
|
||||
if (row.status === 1) {
|
||||
const r = this.taskRowResultTrim(row)
|
||||
if (!r) return 'vg-chat-inline-status--failed'
|
||||
if (/^cgt/i.test(r)) return 'vg-chat-inline-status--running'
|
||||
if (this.isHttpOrHttpsUrl(r)) return 'vg-chat-inline-status--running'
|
||||
return 'vg-chat-inline-status--failed'
|
||||
}
|
||||
if (row.status === 1 && !this.isHttpOrHttpsUrl(row.result)) return 'vg-chat-inline-status--failed'
|
||||
return 'vg-chat-inline-status--running'
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -67,14 +67,6 @@ public class TencentCosUtil {
|
|||
try {
|
||||
InputStream inputStream = file.getInputStream();
|
||||
ObjectMetadata objectMetadata = new ObjectMetadata();
|
||||
// 必须设置长度,否则底层 OkHttp 会告警「No content length specified…」并整段缓冲到内存,易 OOM
|
||||
long contentLength = file.getSize();
|
||||
if (contentLength >= 0) {
|
||||
objectMetadata.setContentLength(contentLength);
|
||||
}
|
||||
if (file.getContentType() != null && !file.getContentType().isEmpty()) {
|
||||
objectMetadata.setContentType(file.getContentType());
|
||||
}
|
||||
PutObjectRequest putObjectRequest = new PutObjectRequest(
|
||||
bucketName,
|
||||
key,
|
||||
|
|
|
|||
Loading…
Reference in New Issue