mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-27 14:09:43 +08:00
对title和desp encode
This commit is contained in:
parent
f8706815d6
commit
647db4c9c1
|
@ -152,7 +152,7 @@ export default class NotificationService {
|
|||
private async serverChan() {
|
||||
const { serverChanKey } = this.params;
|
||||
const matchResult = serverChanKey.match(/^sctp(\d+)t/i);
|
||||
const url = matchResult
|
||||
const url = matchResult && matchResult[1]
|
||||
? `https://${matchResult[1]}.push.ft07.com/send/${serverChanKey}.send`
|
||||
: `https://sctapi.ftqq.com/${serverChanKey}.send`;
|
||||
|
||||
|
@ -160,7 +160,7 @@ export default class NotificationService {
|
|||
const res: any = await got
|
||||
.post(url, {
|
||||
...this.gotOption,
|
||||
body: `title=${this.title}&desp=${this.content}`,
|
||||
body: `title=${encodeURIComponent(this.title)}&desp=${encodeURIComponent(this.content)}`,
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
})
|
||||
.json();
|
||||
|
|
|
@ -227,7 +227,7 @@ function serverNotify(text, desp) {
|
|||
|
||||
const matchResult = PUSH_KEY.match(/^sctp(\d+)t/i);
|
||||
const options = {
|
||||
url: matchResult
|
||||
url: matchResult && matchResult[1]
|
||||
? `https://${matchResult[1]}.push.ft07.com/send/${PUSH_KEY}.send`
|
||||
: `https://sctapi.ftqq.com/${PUSH_KEY}.send`,
|
||||
body: `text=${encodeURIComponent(text)}&desp=${encodeURIComponent(desp)}`,
|
||||
|
|
Loading…
Reference in New Issue
Block a user