feat: tranbox: mobile support

This commit is contained in:
Gabe Yuan
2024-04-07 16:55:54 +08:00
parent 2f5d875c47
commit d565e2464a
4 changed files with 10 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ import {
URL_BAIDU_WEB,
URL_BAIDU_TRANSAPI_V2,
URL_BAIDU_TRANSAPI,
DEFAULT_USER_AGENT,
} from "../config";
import { fetchApi } from "../libs/fetch";
@@ -248,7 +249,9 @@ export const genBaidu = async ({ text, from, to }) => {
const init = {
headers: {
// Origin: "https://fanyi.baidu.com",
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
"User-Agent": DEFAULT_USER_AGENT,
},
method: "POST",
body: queryString.stringify(data),