From a809b89bb0ce77b66f05f9b764c140f0842fcbcc Mon Sep 17 00:00:00 2001 From: Ghost Lee Date: Tue, 8 Feb 2022 18:45:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DgoCqHttpBotToken=E4=B8=AD?= =?UTF-8?q?=E5=AD=98=E5=9C=A8&=E5=AD=97=E7=AC=A6=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#993)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改goCqHttpBot鉴权方式,调整为使用Header模式 --- back/services/notify.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/back/services/notify.ts b/back/services/notify.ts index 1a12abd0..7b6edc55 100644 --- a/back/services/notify.ts +++ b/back/services/notify.ts @@ -91,11 +91,12 @@ export default class NotificationService { const { goCqHttpBotQq, goCqHttpBotToken, goCqHttpBotUrl } = this.params; const res: any = await got .post( - `${goCqHttpBotUrl}?access_token=${goCqHttpBotToken}&${goCqHttpBotQq}`, + `${goCqHttpBotUrl}?${goCqHttpBotQq}`, { timeout: this.timeout, retry: 0, json: { message: `${this.title}\n${this.content}` }, + headers: { 'Authorization': 'Bearer '+goCqHttpBotToken }, }, ) .json();