增加公共下载进度、增加接收SKU、密钥分别存放
This commit is contained in:
@@ -161,6 +161,7 @@ import { getPywebviewApi } from '@/shared/bridges/pywebview'
|
||||
import { getTaskPollIntervalMs } from '@/shared/task-progress-config'
|
||||
import { getStoredApiSecret } from '@/shared/utils/api-secret-store'
|
||||
import { createCategorizedTimers } from '@/shared/utils/categorized-timers'
|
||||
import { saveUrlWithProgress } from '@/shared/utils/download-progress'
|
||||
|
||||
const selectedFileNames = ref<string[]>([])
|
||||
const uploadedFiles = ref<UploadFileVo[]>([])
|
||||
@@ -257,7 +258,7 @@ function queueAiPrompt() {
|
||||
}
|
||||
|
||||
function effectiveCozeApiKey() {
|
||||
return getStoredApiSecret().trim()
|
||||
return getStoredApiSecret('appearance-patent').trim()
|
||||
}
|
||||
|
||||
function maskSecret(secret: string) {
|
||||
@@ -462,6 +463,7 @@ async function pushToPythonQueue() {
|
||||
id: row.displayId,
|
||||
asin: row.asin,
|
||||
country: row.country,
|
||||
sku: row.sku || '',
|
||||
url: row.url || '',
|
||||
title: row.title || '',
|
||||
})),
|
||||
@@ -880,14 +882,9 @@ function shouldShowFallbackJobProgress(item: AppearancePatentHistoryItem) {
|
||||
|
||||
async function downloadResult(item: AppearancePatentHistoryItem) {
|
||||
if (!item.resultId) return
|
||||
const api = getPywebviewApi()
|
||||
if (!api?.save_file_from_url_new) {
|
||||
ElMessage.error('当前客户端未提供下载能力')
|
||||
return
|
||||
}
|
||||
const url = item.downloadUrl || getAppearancePatentResultDownloadUrl(item.resultId)
|
||||
const filename = item.resultFilename || `${item.sourceFilename || 'appearance-patent'}.xlsx`
|
||||
const result = await api.save_file_from_url_new(url, filename)
|
||||
const result = await saveUrlWithProgress(url, filename, `appearance-patent:${item.resultId}`)
|
||||
if (result.success) {
|
||||
ElMessage.success(`已保存: ${result.path || filename}`)
|
||||
} else if (result.error && result.error !== '用户取消') {
|
||||
|
||||
Reference in New Issue
Block a user