From ebec2321a78b317fce39455efc2dc2b380047194 Mon Sep 17 00:00:00 2001 From: zhneglili <1278186879@qq.com> Date: Wed, 9 Feb 2022 22:11:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=AF=86=E5=88=AB=E8=AF=AD=E8=A8=80=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E8=87=AA=E5=8A=A8=E7=BF=BB=E8=AF=91=E4=B8=BA=E5=8F=A6?= =?UTF-8?q?=E4=B8=80=E7=A7=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/shell-chrome/assets/js/translate/tran.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/shell-chrome/assets/js/translate/tran.js b/packages/shell-chrome/assets/js/translate/tran.js index abdfaa5..8e23a8a 100644 --- a/packages/shell-chrome/assets/js/translate/tran.js +++ b/packages/shell-chrome/assets/js/translate/tran.js @@ -50,9 +50,6 @@ var from = 'auto'; var to = 'auto'; var postMsg = async function () { - console.log('开始翻译') - from = document.getElementById("inputLangSelect").value - to = document.getElementById("outLangSelect").value var msgq = document.getElementById("inputLang").value // 翻译api msgq = encodeURIComponent(msgq) @@ -62,7 +59,6 @@ var postMsg = async function () { let res1 = await fetch(httpUrl1) let result1 = await res1.json() let res2 = result1.trans_result[0].dst - console.log(result1) document.getElementById("outPutRes").innerHTML = res2 } @@ -97,6 +93,8 @@ document.getElementById("inputLang").onchange = function () { } //直接翻译 document.getElementById("tranbtn").onclick = function () { + from = document.getElementById("inputLangSelect").value + to = document.getElementById("outLangSelect").value postMsg() } //关闭翻译模块