Skip to content

Commit f6d70fb

Browse files
committed
fix baidu
1 parent cca158b commit f6d70fb

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

src/translator/baidu.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,24 @@ export default class baidu extends BaseTranslator {
3838
static async requestTranslate(text, sourceLang, targetLang) {
3939
return await ky
4040
.post(baseUrl, {
41-
searchParams: {
42-
from: sourceLang,
43-
to: targetLang,
44-
},
45-
body: new URLSearchParams({
46-
from: sourceLang,
47-
to: targetLang,
48-
query: text,
49-
source: "txt",
50-
}),
41+
searchParams: {
42+
from: sourceLang,
43+
to: targetLang,
44+
},
45+
body: new URLSearchParams({
46+
from: sourceLang,
47+
to: targetLang,
48+
query: text,
49+
source: "txt",
50+
isAi: false,
51+
sseStartTime: Date.now(),
52+
reference: "",
53+
corpusIds: [],
54+
needPhonetic: false,
55+
domain: "common",
56+
detectLang: "",
57+
milliTimestamp: Date.now(),
58+
}),
5159
})
5260
.json();
5361
}

0 commit comments

Comments
 (0)