diff --git a/en/searchurl/bingAI/js/bing.js b/en/searchurl/bingAI/js/bing.js index 52541c4..d3195d4 100644 --- a/en/searchurl/bingAI/js/bing.js +++ b/en/searchurl/bingAI/js/bing.js @@ -48,13 +48,17 @@ function onMessage(json, returnMessage) { if (json.type == 3) { onMessageIsOKClose = true; returnMessage.getCatWebSocket().close(1000, 'ok'); - } else if (json.type == 1) { - porserArguments(json.arguments); - } else if (json.type == 2) { - porserType2Item(json.item); } else { - console.log(JSON.stringify(json)); - } + talk = undefined; + localStorage.removeItem('LastChatJson'); + if (json.type == 1) { + porserArguments(json.arguments); + } else if (json.type == 2) { + porserType2Item(json.item); + } else { + console.log(JSON.stringify(json)); + } + } } @@ -289,7 +293,7 @@ input_update_input_text_sstyle_show_update({ target: input_text }); //开始新聊天按钮逻辑,仅在聊天复用 restartNewChat.onclick = async () => { - await setLastChatJson(null); + localStorage.removeItem('LastChatJson'); await setLastInvocationId(1); restart_button.onclick(); } diff --git a/en/searchurl/bingAI/js/bingChatHub.js b/en/searchurl/bingAI/js/bingChatHub.js index e1816b9..ddea942 100644 --- a/en/searchurl/bingAI/js/bingChatHub.js +++ b/en/searchurl/bingAI/js/bingChatHub.js @@ -348,7 +348,7 @@ class Chat { } } -function URLTrue(magicUrl, thiePath) { +function URLTrue(url, thiePath) { return url + thiePath; } @@ -367,9 +367,10 @@ async function copyCookies(magicUrl) {} } */ async function createChat(theChatType) { - let chatWithMagic = await getChatHubWithMagic(); - let magicUrl = await getMagicUrl(); - let restartNewChat = document.getElementById('restartNewChat'); + let chatWithMagic = await getChatHubWithMagic(); + let magicUrl = await getMagicUrl(); + let restartNewChat = document.getElementById('restartNewChat'); + if(chatWithMagic=='repeat'){//如果是聊天复用 restartNewChat.classList.remove('onShow'); let resjson = await getLastChatJson(); @@ -385,11 +386,12 @@ async function createChat(theChatType) { }; } } + let mes; do { try { - let res = await fetch(URLTrue(magicUrl,'turing/conversation/create'), - {credentials: 'include'}); + let url = URLTrue(magicUrl,'turing/conversation/create'); + let res = await fetch(url, {credentials: 'include'}); let resjson = await res.json(); if (!resjson.result || resjson.result.value != 'Success') { mes = resjson; diff --git a/en/searchurl/func.html b/en/searchurl/func.html index 26485f9..f73051e 100644 --- a/en/searchurl/func.html +++ b/en/searchurl/func.html @@ -57,7 +57,7 @@ body>ul{padding-left:0;}
  • -
  • +