修复小bug
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* @Author: lxk0301 https://github.com/lxk0301
|
* @Author: lxk0301 https://github.com/lxk0301
|
||||||
* @Date: 2020-08-16 18:54:16
|
* @Date: 2020-08-16 18:54:16
|
||||||
* @Last Modified by: lxk0301
|
* @Last Modified by: lxk0301
|
||||||
* @Last Modified time: 2020-11-05 18:54:37
|
* @Last Modified time: 2020-11-10 18:54:37
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
京小超(活动入口:京东APP-》首页-》京东超市-》底部东东超市)
|
京小超(活动入口:京东APP-》首页-》京东超市-》底部东东超市)
|
||||||
@@ -353,10 +353,16 @@ async function businessCircleActivity() {
|
|||||||
const receivedPkTeamPrize = await smtg_receivedPkTeamPrize();
|
const receivedPkTeamPrize = await smtg_receivedPkTeamPrize();
|
||||||
console.log(`商圈PK奖励领取结果:${JSON.stringify(receivedPkTeamPrize)}`)
|
console.log(`商圈PK奖励领取结果:${JSON.stringify(receivedPkTeamPrize)}`)
|
||||||
if (receivedPkTeamPrize.data.bizCode === 0) {
|
if (receivedPkTeamPrize.data.bizCode === 0) {
|
||||||
|
if (receivedPkTeamPrize.data.result.pkResult === 1) {
|
||||||
const { pkTeamPrizeInfoVO } = receivedPkTeamPrize.data.result;
|
const { pkTeamPrizeInfoVO } = receivedPkTeamPrize.data.result;
|
||||||
message += `【商圈PK奖励】${pkTeamPrizeInfoVO.blueCoin}蓝币领取成功\n`;
|
message += `【商圈PK奖励】${pkTeamPrizeInfoVO.blueCoin}蓝币领取成功\n`;
|
||||||
if ($.isNode()) {
|
if ($.isNode()) {
|
||||||
await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】 ${$.nickName}\n【商圈PK奖励】${pkTeamPrizeInfoVO.blueCoin}蓝币领取成功`)
|
await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】 ${$.nickName}\n【商圈队伍】PK获胜\n【奖励】${pkTeamPrizeInfoVO.blueCoin}蓝币领取成功`)
|
||||||
|
}
|
||||||
|
} else if (receivedPkTeamPrize.data.result.pkResult === 2) {
|
||||||
|
if ($.isNode()) {
|
||||||
|
await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】 ${$.nickName}\n【商圈队伍】PK失败`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (prizeInfo.pkPrizeStatus === 1) {
|
} else if (prizeInfo.pkPrizeStatus === 1) {
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ if (process.env.IGOT_PUSH_KEY) {
|
|||||||
async function sendNotify(text, desp, params = {}) {
|
async function sendNotify(text, desp, params = {}) {
|
||||||
//提供五种通知
|
//提供五种通知
|
||||||
await serverNotify(text, desp);
|
await serverNotify(text, desp);
|
||||||
|
text = text.match(/.*?(?=\s?-)/g) ? text.match(/.*?(?=\s?-)/g)[0] : text;
|
||||||
await BarkNotify(text, desp, params);
|
await BarkNotify(text, desp, params);
|
||||||
await tgBotNotify(text, desp);
|
await tgBotNotify(text, desp);
|
||||||
await ddBotNotify(text, desp);
|
await ddBotNotify(text, desp);
|
||||||
@@ -122,7 +123,7 @@ function BarkNotify(text, desp, params={}) {
|
|||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
if (BARK_PUSH) {
|
if (BARK_PUSH) {
|
||||||
const options = {
|
const options = {
|
||||||
url: `${BARK_PUSH}/${encodeURIComponent(text.match(/.*?(?=\s?-)/g) && text.match(/.*?(?=\s?-)/g)[0])}/${encodeURIComponent(desp)}?sound=${BARK_SOUND}&${querystring.stringify(params)}`,
|
url: `${BARK_PUSH}/${encodeURIComponent(text)}/${encodeURIComponent(desp)}?sound=${BARK_SOUND}&${querystring.stringify(params)}`,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded'
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
}
|
}
|
||||||
@@ -158,7 +159,7 @@ function tgBotNotify(text, desp) {
|
|||||||
if (TG_BOT_TOKEN && TG_USER_ID) {
|
if (TG_BOT_TOKEN && TG_USER_ID) {
|
||||||
const options = {
|
const options = {
|
||||||
url: `https://api.telegram.org/bot${TG_BOT_TOKEN}/sendMessage`,
|
url: `https://api.telegram.org/bot${TG_BOT_TOKEN}/sendMessage`,
|
||||||
body: `chat_id=${TG_USER_ID}&text=${text.match(/.*?(?=\s?-)/g) && text.match(/.*?(?=\s?-)/g)[0]}\n\n${desp}&disable_web_page_preview=true`,
|
body: `chat_id=${TG_USER_ID}&text=${text}\n\n${desp}&disable_web_page_preview=true`,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded'
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
}
|
}
|
||||||
@@ -209,7 +210,7 @@ function ddBotNotify(text, desp) {
|
|||||||
json: {
|
json: {
|
||||||
"msgtype": "text",
|
"msgtype": "text",
|
||||||
"text": {
|
"text": {
|
||||||
"content": ` ${text.match(/.*?(?=\s?-)/g) && text.match(/.*?(?=\s?-)/g)[0]}\n\n${desp}`
|
"content": ` ${text}\n\n${desp}`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
@@ -281,7 +282,7 @@ function iGotNotify(text, desp, params={}){
|
|||||||
}
|
}
|
||||||
const options = {
|
const options = {
|
||||||
url: `https://push.hellyw.com/${IGOT_PUSH_KEY.toLowerCase()}`,
|
url: `https://push.hellyw.com/${IGOT_PUSH_KEY.toLowerCase()}`,
|
||||||
body: `title=${text.match(/.*?(?=\s?-)/g) && text.match(/.*?(?=\s?-)/g)[0]}&content=${desp}&${querystring.stringify(params)}`,
|
body: `title=${text}&content=${desp}&${querystring.stringify(params)}`,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded'
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user