From 9006fdc938768a029feffa295639d0a23df58969 Mon Sep 17 00:00:00 2001 From: overwriter <9856mmm@gmail.com> Date: Thu, 27 Jun 2024 20:18:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=BB=98=E8=AE=A4=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=80=BC=E9=83=BD=E6=98=AF=E6=9C=AA=E5=8A=A0=E5=AF=86?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/request.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/util/request.js b/util/request.js index 12108bd..7316732 100644 --- a/util/request.js +++ b/util/request.js @@ -204,11 +204,7 @@ const createRequest = (method, uri, data = {}, options) => { x.replace(/\s*Domain=[^(;|$)]+;*/, ''), ) try { - if (options.crypto === 'eapi') { - answer.body = JSON.parse(encrypt.decrypt(body)) - } else { - answer.body = body - } + answer.body = JSON.parse(body.toString()) if (answer.body.code) { answer.body.code = Number(answer.body.code) } @@ -224,7 +220,7 @@ const createRequest = (method, uri, data = {}, options) => { } catch (e) { // console.log(e) try { - answer.body = JSON.parse(body.toString()) + answer.body = JSON.parse(encrypt.decrypt(body)) } catch (err) { // console.log(err) // can't decrypt and can't parse directly