Update storage.js via upload script - 2026-11-09 15:30:36

This commit is contained in:
mike 2026-11-09 15:30:45 +08:00
parent 36faa567a5
commit 2007f2e601
1 changed files with 2 additions and 2 deletions

View File

@ -335,9 +335,9 @@ export async function getPreciseDoc(id) {
return data;
}
// 把原版彩页翻译成某种语言(AI 翻译,结果存在服务器上,之后切换语言直接显示)
export async function translatePreciseDoc(id, lang) {
export async function translatePreciseDoc(id, lang, force) {
const res = await fetch(`/api/precise/${encodeURIComponent(id)}/translate`, {
method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ lang }),
method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ lang, force: !!force }),
});
const data = await res.json().catch(() => ({}));
if (!res.ok) throw new Error(data.error || `翻译失败(HTTP ${res.status})`);