From 985362f4ed0eb2c07b1903cc62da359f8ca0fbf3 Mon Sep 17 00:00:00 2001 From: weixin_44463441 Date: Thu, 11 Jan 2024 16:07:00 +0800 Subject: [PATCH] Thu Jan 11 16:07:00 CST 2024 inscode --- src/js/repEs.js | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/js/repEs.js b/src/js/repEs.js index 2fcaa86..1d85d18 100644 --- a/src/js/repEs.js +++ b/src/js/repEs.js @@ -51,20 +51,24 @@ class RepEs { user_token: token, content: content, }, - { withCredentials: true} - ).then(res => { - - if (res?.status === 200 && res?.data?.code === 200) { - const result = [] - res?.data?.data?.hits.forEach(element => { - result.push({ - page_content: element?._source?.content - }) - }); - resolve(result) - - } - console.info(res) + { + withCredentials: true, + headers: { + 'Content-Type': 'application/json' + } + }).then(res => { + + if (res?.status === 200 && res?.data?.code === 200) { + const result = [] + res?.data?.data?.hits.forEach(element => { + result.push({ + page_content: element?._source?.content + }) + }); + resolve(result) + + } + console.info(res) }).catch((err) => { -- GitLab