增加公共下载进度、增加接收SKU、密钥分别存放
This commit is contained in:
@@ -340,6 +340,7 @@ import {
|
||||
import { getPywebviewApi } from "@/shared/bridges/pywebview";
|
||||
import { getTaskPollIntervalMs } from "@/shared/task-progress-config";
|
||||
import { createCategorizedTimers } from "@/shared/utils/categorized-timers";
|
||||
import { saveUrlWithProgress } from "@/shared/utils/download-progress";
|
||||
|
||||
const MAX_TRANSIENT_ERRORS = 30;
|
||||
|
||||
@@ -1105,14 +1106,9 @@ async function pushToPythonQueue() {
|
||||
|
||||
async function downloadResult(item: QueryAsinHistoryItem) {
|
||||
if (!item.resultId) return;
|
||||
const api = getPywebviewApi();
|
||||
if (!api?.save_file_from_url_new) {
|
||||
ElMessage.error("当前客户端未提供下载能力");
|
||||
return;
|
||||
}
|
||||
const url = getQueryAsinResultDownloadUrl(item.resultId);
|
||||
const filename = item.outputFilename || `${item.shopName || "result"}.xlsx`;
|
||||
const result = await api.save_file_from_url_new(url, filename);
|
||||
const result = await saveUrlWithProgress(url, filename, `query-asin:${item.resultId}`);
|
||||
if (result.success) {
|
||||
ElMessage.success(`已保存: ${result.path || filename}`);
|
||||
} else if (result.error && result.error !== "用户取消") {
|
||||
|
||||
Reference in New Issue
Block a user