mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-27 14:46:06 +08:00
适配Server酱APP分支(Server酱³),移除已废弃的旧版api入口
This commit is contained in:
parent
6ea8d361fd
commit
719fef68b9
|
@ -151,9 +151,9 @@ export default class NotificationService {
|
||||||
|
|
||||||
private async serverChan() {
|
private async serverChan() {
|
||||||
const { serverChanKey } = this.params;
|
const { serverChanKey } = this.params;
|
||||||
const url = serverChanKey.startsWith('SCT')
|
const url = serverChanKey.startsWith('sctp')
|
||||||
? `https://sctapi.ftqq.com/${serverChanKey}.send`
|
? `https://${serverChanKey}.push.ft07.com/send`
|
||||||
: `https://sc.ftqq.com/${serverChanKey}.send`;
|
: `https://sctapi.ftqq.com/${serverChanKey}.send`;
|
||||||
try {
|
try {
|
||||||
const res: any = await got
|
const res: any = await got
|
||||||
.post(url, {
|
.post(url, {
|
||||||
|
|
|
@ -225,9 +225,9 @@ function serverNotify(text, desp) {
|
||||||
// 微信server酱推送通知一个\n不会换行,需要两个\n才能换行,故做此替换
|
// 微信server酱推送通知一个\n不会换行,需要两个\n才能换行,故做此替换
|
||||||
desp = desp.replace(/[\n\r]/g, '\n\n');
|
desp = desp.replace(/[\n\r]/g, '\n\n');
|
||||||
const options = {
|
const options = {
|
||||||
url: PUSH_KEY.includes('SCT')
|
url: PUSH_KEY.startsWith('sctp')
|
||||||
? `https://sctapi.ftqq.com/${PUSH_KEY}.send`
|
? `https://${PUSH_KEY}.push.ft07.com/send`
|
||||||
: `https://sc.ftqq.com/${PUSH_KEY}.send`,
|
: `https://sctapi.ftqq.com/${PUSH_KEY}.send`,
|
||||||
body: `text=${text}&desp=${desp}`,
|
body: `text=${text}&desp=${desp}`,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
|
|
@ -298,10 +298,10 @@ def serverJ(title: str, content: str) -> None:
|
||||||
print("serverJ 服务启动")
|
print("serverJ 服务启动")
|
||||||
|
|
||||||
data = {"text": title, "desp": content.replace("\n", "\n\n")}
|
data = {"text": title, "desp": content.replace("\n", "\n\n")}
|
||||||
if push_config.get("PUSH_KEY").find("SCT") != -1:
|
if push_config.get("PUSH_KEY").startswith("sctp"):
|
||||||
url = f'https://sctapi.ftqq.com/{push_config.get("PUSH_KEY")}.send'
|
url = f'https://{push_config.get("PUSH_KEY")}.push.ft07.com/send'
|
||||||
else:
|
else:
|
||||||
url = f'https://sc.ftqq.com/{push_config.get("PUSH_KEY")}.send'
|
url = f'https://sctapi.ftqq.com/{push_config.get("PUSH_KEY")}.send'
|
||||||
response = requests.post(url, data=data).json()
|
response = requests.post(url, data=data).json()
|
||||||
|
|
||||||
if response.get("errno") == 0 or response.get("code") == 0:
|
if response.get("errno") == 0 or response.get("code") == 0:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user