bark 推送改为 post 请求

This commit is contained in:
whyour
2024-06-07 10:54:58 +08:00
parent c3908e956f
commit 69d9307be9
3 changed files with 56 additions and 36 deletions
+14 -7
View File
@@ -358,17 +358,24 @@ function barkNotify(text, desp, params = {}) {
BARK_PUSH = `https://api.day.app/${BARK_PUSH}`;
}
const options = {
url: `${BARK_PUSH}/${encodeURIComponent(text)}/${encodeURIComponent(
desp,
)}?icon=${BARK_ICON}&sound=${BARK_SOUND}&group=${BARK_GROUP}&isArchive=${BARK_ARCHIVE}&level=${BARK_LEVEL}&url=${BARK_URL}&${querystring.stringify(
params,
)}`,
url: `${BARK_PUSH}`,
json: {
title: text,
body: desp,
icon: BARK_ICON,
sound: BARK_SOUND,
group: BARK_GROUP,
isArchive: BARK_ARCHIVE,
level: BARK_LEVEL,
url: BARK_URL,
...params,
},
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Type': 'application/json',
},
timeout,
};
$.get(options, (err, resp, data) => {
$.post(options, (err, resp, data) => {
try {
if (err) {
console.log('Bark APP 发送通知调用API失败😞\n', err);