mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-27 14:46:06 +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() {
|
private async serverChan() {
|
||||||
const { serverChanKey } = this.params;
|
const { serverChanKey } = this.params;
|
||||||
const matchResult = serverChanKey.match(/^sctp(\d+)t/i);
|
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://${matchResult[1]}.push.ft07.com/send/${serverChanKey}.send`
|
||||||
: `https://sctapi.ftqq.com/${serverChanKey}.send`;
|
: `https://sctapi.ftqq.com/${serverChanKey}.send`;
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ export default class NotificationService {
|
||||||
const res: any = await got
|
const res: any = await got
|
||||||
.post(url, {
|
.post(url, {
|
||||||
...this.gotOption,
|
...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' },
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||||
})
|
})
|
||||||
.json();
|
.json();
|
||||||
|
|
|
@ -227,7 +227,7 @@ function serverNotify(text, desp) {
|
||||||
|
|
||||||
const matchResult = PUSH_KEY.match(/^sctp(\d+)t/i);
|
const matchResult = PUSH_KEY.match(/^sctp(\d+)t/i);
|
||||||
const options = {
|
const options = {
|
||||||
url: matchResult
|
url: matchResult && matchResult[1]
|
||||||
? `https://${matchResult[1]}.push.ft07.com/send/${PUSH_KEY}.send`
|
? `https://${matchResult[1]}.push.ft07.com/send/${PUSH_KEY}.send`
|
||||||
: `https://sctapi.ftqq.com/${PUSH_KEY}.send`,
|
: `https://sctapi.ftqq.com/${PUSH_KEY}.send`,
|
||||||
body: `text=${encodeURIComponent(text)}&desp=${encodeURIComponent(desp)}`,
|
body: `text=${encodeURIComponent(text)}&desp=${encodeURIComponent(desp)}`,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user