From 5363e1f83dc563b3ea8f73fb6abd03c8ee084eb6 Mon Sep 17 00:00:00 2001 From: zyronon Date: Sun, 10 Sep 2023 23:59:14 +0800 Subject: [PATCH] chore: update netify.toml --- netlify.toml | 4 +++- src/components/Practice/TypeArticle.vue | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/netlify.toml b/netlify.toml index e12870a6..782b28e8 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,3 +1,5 @@ [[redirects]] from = "/baidu" - to = "https://api.fanyi.baidu.com/api/trans/vip/translate" \ No newline at end of file + to = "https://api.fanyi.baidu.com/api/trans/vip/translate" + status = 200 + force = true \ No newline at end of file diff --git a/src/components/Practice/TypeArticle.vue b/src/components/Practice/TypeArticle.vue index f4aaae29..ea109e78 100644 --- a/src/components/Practice/TypeArticle.vue +++ b/src/components/Practice/TypeArticle.vue @@ -103,13 +103,15 @@ onMounted(() => { key: "Xxe_yftQR3K3Ue43NQMC" } }) - baidu.translate('fuck', 'en', 'zh-CN').then(r => { - console.log('s', r) - }) + practiceStore.total = 0 sections.map((v, i) => { v.map((w, j) => { - w.translate = temp[i][j].sentence + baidu.translate(w.sentence, 'en', 'zh-CN').then(r => { + console.log('s', r.trans.paragraphs) + w.translate = r.trans.paragraphs[0] + }) + // w.translate = temp[i][j].sentence w.words.map(s => { if (!store.skipWordNamesWithSimpleWords.includes(s.name.toLowerCase()) && !s.isSymbol) { practiceStore.total++