diff --git a/Scripts/AddMsGames.js b/Scripts/AddMsGames.js index b9c13f4..a4ae61c 100644 --- a/Scripts/AddMsGames.js +++ b/Scripts/AddMsGames.js @@ -526,18 +526,57 @@ ${failedHtml} }); } + function doneWithPage(title, message, type = "warn") { + const color = type === "error" ? "#e05050" : type === "warn" ? "#e8a838" : "#52b043"; + const icon = type === "error" ? "❌" : type === "warn" ? "⚠️" : "✅"; + const html = ` + + + + +Xbox · ${flag}${label} + + + +
+
${icon}
+
${title}
+
${message}
+ +
+ +`; + $done({ response: { status: 200, headers: { "Content-Type": "text/html;charset=utf-8", "Cache-Control": "no-store, no-cache, must-revalidate", "Pragma": "no-cache" }, body: html } }); + } + function startTask() { if (!MUID || !MS_CV) { $notification.post(`❌ Xbox ${label} 错误`, `缺少 MUID 或 CV`, `请写入 ${MUID_KEY} / ${CV_KEY}`); - $done({}); + doneWithPage("缺少必要参数", `未找到 MUID 或 MS-CV,请确认已正确写入:

${MUID_KEY}
${CV_KEY}`, "error"); return; } if (productList.length === 0) { $notification.post(`⚠️ Xbox ${label}`, "列表为空,无需执行", `来源: ${sourceLabel}`); if (useRemote) { - $httpClient.post({ url: REMOTE_COMMIT_URL, headers: { "Content-Type": "application/json" }, body: JSON.stringify({ remaining: {} }) }, () => $done({})); + $httpClient.post({ url: REMOTE_COMMIT_URL, headers: { "Content-Type": "application/json" }, body: JSON.stringify({ remaining: {} }) }, () => { + doneWithPage("暂无商品", `远程队列与本地列表均为空,无需加购。

来源: ${sourceLabel}`, "warn"); + }); } else { - $done({}); + doneWithPage("暂无商品", `远程队列与本地列表均为空,无需加购。

来源: ${sourceLabel}`, "warn"); } return; }