From 769a4f00aa6bf2718f0268a933b1df50388c2968 Mon Sep 17 00:00:00 2001 From: Gabe Date: Fri, 10 Oct 2025 00:08:38 +0800 Subject: [PATCH] fix: bing dict --- src/apis/index.js | 2 +- src/views/Selection/DictCont.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apis/index.js b/src/apis/index.js index b860091..21d957e 100644 --- a/src/apis/index.js +++ b/src/apis/index.js @@ -140,7 +140,7 @@ export const apiMicrosoftDict = async (text) => { const parser = new DOMParser(); const doc = parser.parseFromString(str, "text/html"); - const word = doc.querySelector("#headword > h1").textContent.trim(); + const word = doc.querySelector("#headword > h1")?.textContent.trim(); if (!word) { return null; } diff --git a/src/views/Selection/DictCont.js b/src/views/Selection/DictCont.js index 6251a57..3fcad7d 100644 --- a/src/views/Selection/DictCont.js +++ b/src/views/Selection/DictCont.js @@ -35,7 +35,7 @@ function DictBody({ text, setCopyText, setRealWord, dict }) { } if (!data) { - return Empty result; + return Not found!; } return (