Add recovery Excel export and automatic account detection

This commit is contained in:
巫凤萍
2026-08-05 11:40:29 +08:00
parent b081946752
commit 85110bbfce
15 changed files with 852 additions and 36 deletions

View File

@@ -36,7 +36,6 @@ type PartnerBody = {
claimantIdentifier?: string;
claimantName?: string;
quantity?: number;
accountNickname?: string;
publishUrl?: string;
exposure?: number | string;
views?: number | string;
@@ -762,11 +761,10 @@ async function handlePost(request: Request) {
if (body.action === "submit") {
const claimToken = textValue(body.claimToken, 80);
const distributionId = textValue(body.distributionId, 80);
const accountNickname = textValue(body.accountNickname, 80);
const publishInput = textValue(body.publishUrl, 5000);
if (!accountNickname || !publishInput) {
if (!publishInput) {
return Response.json(
{ error: "请填写发布账号昵称和发布链接" },
{ error: "请填写发布链接" },
{ status: 400 },
);
}
@@ -777,7 +775,7 @@ async function handlePost(request: Request) {
{ status: 400 },
);
}
const account = accountFromPublishLink(publishUrl, accountNickname);
const account = accountFromPublishLink(publishUrl);
if (!account) {
return Response.json({ error: "发布链接格式不正确" }, { status: 400 });
}
@@ -881,7 +879,7 @@ async function handlePost(request: Request) {
db,
assignment.id,
publishUrl,
accountNickname,
account.nickname,
resolveCollectionMcpConfig(
env as unknown as CollectionMcpBindings,
),