修复goCqHttpBotToken中存在&字符导致认证失败的问题 (#993)

修改goCqHttpBot鉴权方式,调整为使用Header模式
This commit is contained in:
Ghost Lee 2022-02-08 18:45:24 +08:00 committed by GitHub
parent 89e08953cb
commit a809b89bb0

View File

@ -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();