Update storage.js via upload script - 2026-11-09 15:30:36
This commit is contained in:
parent
36faa567a5
commit
2007f2e601
|
|
@ -335,9 +335,9 @@ export async function getPreciseDoc(id) {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
// 把原版彩页翻译成某种语言(AI 翻译,结果存在服务器上,之后切换语言直接显示)
|
// 把原版彩页翻译成某种语言(AI 翻译,结果存在服务器上,之后切换语言直接显示)
|
||||||
export async function translatePreciseDoc(id, lang) {
|
export async function translatePreciseDoc(id, lang, force) {
|
||||||
const res = await fetch(`/api/precise/${encodeURIComponent(id)}/translate`, {
|
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(() => ({}));
|
const data = await res.json().catch(() => ({}));
|
||||||
if (!res.ok) throw new Error(data.error || `翻译失败(HTTP ${res.status})`);
|
if (!res.ok) throw new Error(data.error || `翻译失败(HTTP ${res.status})`);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue