feat(account): record downloads and show reviews

This commit is contained in:
2026-05-19 00:25:57 +08:00
parent 8da044495a
commit 78a04fb51f
8 changed files with 323 additions and 7 deletions
+7 -4
View File
@@ -21,16 +21,18 @@ import axios from "axios";
const logger = pino({ name: "processInstall.ts" });
export const handleInstall = async (appObj?: App) => {
export const handleInstall = async (
appObj?: App,
): Promise<DownloadItem | null> => {
const targetApp = appObj || currentApp.value;
if (!targetApp?.pkgname) return;
if (!targetApp?.pkgname) return null;
// APM 应用:在创建下载任务前检查 APM 是否可用
if (targetApp.origin === "apm") {
const hasApm = await window.ipcRenderer.invoke("check-apm-available");
if (!hasApm) {
showApmInstallDialog.value = true;
return;
return null;
}
}
@@ -42,7 +44,7 @@ export const handleInstall = async (appObj?: App) => {
logger.info(
`任务已存在,忽略重复添加: ${targetApp.pkgname} (${targetApp.origin})`,
);
return;
return null;
}
// 创建下载任务
@@ -98,6 +100,7 @@ export const handleInstall = async (appObj?: App) => {
.then((response) => {
logger.info("下载次数统计已发送,状态:", response.data);
});
return download;
};
export const handleRetry = (download_: DownloadItem) => {