改为Promise.all
This commit is contained in:
@@ -131,7 +131,7 @@ async function downFile () {
|
|||||||
async function changeFile (content) {
|
async function changeFile (content) {
|
||||||
console.log(`开始替换变量`)
|
console.log(`开始替换变量`)
|
||||||
let newContent = content.replace(/var Key = ''/, `var Key = '${cookie}'`);
|
let newContent = content.replace(/var Key = ''/, `var Key = '${cookie}'`);
|
||||||
// newContent = newContent.replace(/const NodeSet = 'CookieSet.json'/, `const NodeSet = '${NodeSet}'`)
|
newContent = newContent.replace(/const NodeSet = 'CookieSet.json'/, `const NodeSet = '${NodeSet}'`)
|
||||||
if (process.env.JD_BEAN_STOP && process.env.JD_BEAN_STOP !== '0') {
|
if (process.env.JD_BEAN_STOP && process.env.JD_BEAN_STOP !== '0') {
|
||||||
newContent = newContent.replace(/var stop = 0/, `var stop = ${process.env.JD_BEAN_STOP * 1}`);
|
newContent = newContent.replace(/var stop = 0/, `var stop = ${process.env.JD_BEAN_STOP * 1}`);
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* @Author: lxk0301 https://github.com/lxk0301
|
* @Author: lxk0301 https://github.com/lxk0301
|
||||||
* @Date: 2020-08-19 16:12:40
|
* @Date: 2020-08-19 16:12:40
|
||||||
* @Last Modified by: lxk0301
|
* @Last Modified by: lxk0301
|
||||||
* @Last Modified time: 2020-12-21 13:52:54
|
* @Last Modified time: 2021-1-5 17:52:54
|
||||||
*/
|
*/
|
||||||
const querystring = require("querystring");
|
const querystring = require("querystring");
|
||||||
const $ = new Env();
|
const $ = new Env();
|
||||||
@@ -132,17 +132,21 @@ if (process.env.PUSH_PLUS_USER) {
|
|||||||
|
|
||||||
async function sendNotify(text, desp, params = {}) {
|
async function sendNotify(text, desp, params = {}) {
|
||||||
//提供7种通知
|
//提供7种通知
|
||||||
await serverNotify(text, desp);//微信server酱
|
await Promise.all([
|
||||||
await pushPlusNotify(text, desp);//pushplus(推送加)
|
serverNotify(text, desp),//微信server酱
|
||||||
|
pushPlusNotify(text, desp)//pushplus(推送加)
|
||||||
|
])
|
||||||
//由于上述两种微信通知需点击进去才能查看到详情,故text(标题内容)携带了账号序号以及昵称信息,方便不点击也可知道是哪个京东哪个活动
|
//由于上述两种微信通知需点击进去才能查看到详情,故text(标题内容)携带了账号序号以及昵称信息,方便不点击也可知道是哪个京东哪个活动
|
||||||
text = text.match(/.*?(?=\s?-)/g) ? text.match(/.*?(?=\s?-)/g)[0] : text;
|
text = text.match(/.*?(?=\s?-)/g) ? text.match(/.*?(?=\s?-)/g)[0] : text;
|
||||||
await BarkNotify(text, desp, params);//iOS Bark APP
|
await Promise.all([
|
||||||
await tgBotNotify(text, desp);//telegram 机器人
|
BarkNotify(text, desp, params),//iOS Bark APP
|
||||||
await ddBotNotify(text, desp);//钉钉机器人
|
tgBotNotify(text, desp),//telegram 机器人
|
||||||
await qywxBotNotify(text, desp); //企业微信机器人
|
ddBotNotify(text, desp),//钉钉机器人
|
||||||
await qywxamNotify(text, desp); //企业微信应用消息推送
|
qywxBotNotify(text, desp), //企业微信机器人
|
||||||
await iGotNotify(text, desp, params);//iGot
|
qywxamNotify(text, desp), //企业微信应用消息推送
|
||||||
await CoolPush(text, desp);//QQ酷推
|
iGotNotify(text, desp, params),//iGot
|
||||||
|
CoolPush(text, desp)//QQ酷推
|
||||||
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
function serverNotify(text, desp, timeout = 2100) {
|
function serverNotify(text, desp, timeout = 2100) {
|
||||||
|
Reference in New Issue
Block a user