Your Name 1912bcd25b
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
chore: sync all remaining local workspace changes
2026-05-08 11:26:57 +08:00

130 lines
3.3 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: 042913757dfeb33b.7750222294.js
* Module id: 708771
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
var t = e.i(325528),
r = e.i(383924);
let i = async (e) => {
try {
let i = await r.apiClient.post(
`${t.config.tv.apiHost}/api/community/image/verify`,
{ urlList: e },
);
return 0 === i.code ? i.data.list : null;
} catch {}
},
n = async (e) => {
try {
let i = await r.apiClient.post(
`${t.config.tv.apiHost}/api/community/video/audit`,
e,
);
return 0 === i.code ? i.data : null;
} catch {
return null;
}
},
a = async (e) => {
try {
let i = await r.apiClient.post(
`${t.config.tv.apiHost}/api/community/video/auditResult`,
e,
);
return 0 === i.code ? i.data : null;
} catch {
return null;
}
},
s = async (e) => {
try {
let i = await r.apiClient.post(
`${t.config.tv.bridgeApiHost}/gateway/common-server-api/common-service/api/translate/text`,
{ reqSourceType: "sd", ...e },
);
return i?.data ?? "";
} catch {
return "";
}
};
e.s(
[
"fileReview",
0,
i,
"translateText",
0,
s,
"videoAudit",
0,
n,
"videoAuditResult",
0,
a,
],
708771,
);
class l extends Error {
constructor(e = "图片审核未通过") {
super(e), (this.name = "FileReviewError");
}
}
class o extends Error {
constructor(e = "媒体审核未通过") {
super(e), (this.name = "MediaAuditError");
}
}
let u = { VIDEO: 1, AUDIO: 2 },
c = { [u.VIDEO]: "视频", [u.AUDIO]: "音频" };
async function d(e, t = u.VIDEO, r) {
let i = c[t],
s = await n({ videoUrl: e, auditContentType: t });
if (r?.()) return;
let l = s?.processUuid;
if (!l) throw new o(`${i}审核发起失败,请稍后重试`);
for (let e = 0; e < 300; e++) {
if ((await new Promise((e) => setTimeout(e, 1e3)), r?.())) return;
let e = await a({ processUuid: l });
if (r?.()) return;
let t = (function (e) {
let t = e?.auditStatus ?? e?.status;
if ("number" == typeof t) return t;
if ("string" == typeof t && "" !== t.trim()) {
let e = Number(t);
return Number.isFinite(e) ? e : null;
}
return null;
})(e);
if (1 === t) return;
if (2 === t) throw new o(`${i}审核未通过`);
if (3 === t) throw new o(`${i}审核异常,请稍后重试`);
}
if (!r?.()) throw new o(`${i}审核超时,请稍后重试`);
}
e.s(
[
"AuditContentType",
0,
u,
"FileReviewError",
() => l,
"MediaAuditError",
() => o,
"VideoAuditError",
0,
o,
"pollMediaAudit",
() => d,
"pollVideoAudit",
0,
d,
],
616803,
);
};
export default moduleFactory;