Compare commits

...

4 Commits

Author SHA1 Message Date
smallfawn
9360acb49e F 2025-03-09 21:38:09 +08:00
smallfawn
c542fd91b2 FIX BUG 2025-03-09 21:12:35 +08:00
smallfawn
ad512729ea Update bawangchaji.js 2025-03-09 21:08:23 +08:00
smallfawn
ca57772d6d 修复通知 2025-03-09 21:01:13 +08:00
9 changed files with 233 additions and 254 deletions

2
dw.js

File diff suppressed because one or more lines are too long

View File

@ -168,7 +168,7 @@ class Task extends Public {
})() })()
.catch((e) => console.log(e)) .catch((e) => console.log(e))
.finally(() => $.done()); .finally(() => $.done());
async function getNotice() { async function getNotice() {
let options = { let options = {
@ -205,20 +205,17 @@ function Env(t, s) {
} }
async sendMsg() { async sendMsg() {
this.log("==============📣Center 通知📣==============") this.log("==============📣Center 通知📣==============")
for (let item of this.notifyStr) { for (let i = 0; i < this.notifyStr.length; i++) {
if (Object.prototype.toString.call(item) === '[object Object]') { if (Object.prototype.toString.call(this.notifyStr[i]) === '[object Object]' ||
item = JSON.stringify(item) Object.prototype.toString.call(this.notifyStr[i]) === '[object Array]') {
} this.notifyStr[i] = JSON.stringify(this.notifyStr[i]);
if (Object.prototype.toString.call(arg) === '[object Array]') {
item = JSON.stringify(item)
} }
} }
let message = this.notifyStr.join(this.logSeparator); let message = this.notifyStr.join(this.logSeparator);
if (this.isNode()) { if (this.isNode()) {
await notify.sendNotify(this.name, message); await notify.sendNotify(this.name, message);
} else { } else {
} }
} }
isNode() { isNode() {
@ -320,8 +317,8 @@ function Env(t, s) {
wait(t) { wait(t) {
return new Promise((s) => setTimeout(s, t)); return new Promise((s) => setTimeout(s, t));
} }
done(t = {}) { async done(t = {}) {
this.sendMsg(); await this.sendMsg();
const s = new Date().getTime(), const s = new Date().getTime(),
e = (s - this.startTime) / 1e3; e = (s - this.startTime) / 1e3;
this.log( this.log(

View File

@ -36,8 +36,8 @@ class _0x4c79d9 {
this.name = ""; this.name = "";
this.valid = false; this.valid = false;
const _0x16f1db = { const _0x16f1db = {
"limit": 0 "limit": 0
}, },
_0x41e123 = { _0x41e123 = {
"Connection": "keep-alive" "Connection": "keep-alive"
}, },
@ -89,7 +89,7 @@ class _0x4c79d9 {
this.log("[" + _0x1692ef + "]请求超时(" + _0x1952e1 / 1000 + "秒),重试第" + _0x43077e + "次"); this.log("[" + _0x1692ef + "]请求超时(" + _0x1952e1 / 1000 + "秒),重试第" + _0x43077e + "次");
} else { } else {
{ {
if (_0x57c026.includes(_0x5a4ec4?.["name"])) this.log("[" + _0x1692ef + "]请求超时(" + _0x5a4ec4.code + "),重试第" + _0x43077e + "次");else { if (_0x57c026.includes(_0x5a4ec4?.["name"])) this.log("[" + _0x1692ef + "]请求超时(" + _0x5a4ec4.code + "),重试第" + _0x43077e + "次"); else {
if (_0x15a3b6.includes(_0x5a4ec4?.["code"])) { if (_0x15a3b6.includes(_0x5a4ec4?.["code"])) {
this.log("[" + _0x1692ef + "]请求错误(" + _0x5a4ec4.code + "),重试第" + _0x43077e + "次"); this.log("[" + _0x1692ef + "]请求错误(" + _0x5a4ec4.code + "),重试第" + _0x43077e + "次");
} else { } else {
@ -119,7 +119,7 @@ class _0x4c79d9 {
} = _0x2d2118; } = _0x2d2118;
if (_0x204398) try { if (_0x204398) try {
_0x204398 = JSON.parse(_0x204398); _0x204398 = JSON.parse(_0x204398);
} catch {} } catch { }
const _0x21a81f = { const _0x21a81f = {
"statusCode": _0x15e772, "statusCode": _0x15e772,
"headers": _0x2501a2, "headers": _0x2501a2,
@ -160,8 +160,8 @@ class _0x5026b8 extends _0x4c79d9 {
let _0x24397b = false; let _0x24397b = false;
try { try {
const _0x496d1a = { const _0x496d1a = {
"appid": _0x50be96 "appid": _0x50be96
}, },
_0x18d4d1 = { _0x18d4d1 = {
"fn": "personal_info", "fn": "personal_info",
"method": "get", "method": "get",
@ -169,9 +169,9 @@ class _0x5026b8 extends _0x4c79d9 {
"searchParams": _0x496d1a "searchParams": _0x496d1a
}; };
let { let {
result: _0x19b336, result: _0x19b336,
statusCode: _0xdca021 statusCode: _0xdca021
} = await this.request(_0x18d4d1), } = await this.request(_0x18d4d1),
_0x1de7e8 = _0x22822c.get(_0x19b336, "code", _0xdca021); _0x1de7e8 = _0x22822c.get(_0x19b336, "code", _0xdca021);
if (_0x1de7e8 == 0) { if (_0x1de7e8 == 0) {
{ {
@ -197,8 +197,8 @@ class _0x5026b8 extends _0x4c79d9 {
try { try {
{ {
const _0x4f8226 = { const _0x4f8226 = {
"appid": _0x50be96 "appid": _0x50be96
}, },
_0x5bc0c4 = { _0x5bc0c4 = {
"fn": "sign_detail", "fn": "sign_detail",
"method": "post", "method": "post",
@ -206,17 +206,17 @@ class _0x5026b8 extends _0x4c79d9 {
"json": _0x4f8226 "json": _0x4f8226
}; };
let { let {
result: _0xdbe43a, result: _0xdbe43a,
statusCode: _0x8c7f96 statusCode: _0x8c7f96
} = await this.request(_0x5bc0c4), } = await this.request(_0x5bc0c4),
_0x57fa7a = _0x22822c.get(_0xdbe43a, "code", _0x8c7f96); _0x57fa7a = _0x22822c.get(_0xdbe43a, "code", _0x8c7f96);
if (_0x57fa7a == 0) { if (_0x57fa7a == 0) {
{ {
let { let {
continuityTotal: _0x2f384b, continuityTotal: _0x2f384b,
signInDateList: _0x5e7d20, signInDateList: _0x5e7d20,
activityId: _0x403c0d activityId: _0x403c0d
} = _0xdbe43a?.["data"], } = _0xdbe43a?.["data"],
_0x5928f0 = false, _0x5928f0 = false,
_0x20dde1 = _0x22822c.time("yyyy-MM-dd"); _0x20dde1 = _0x22822c.time("yyyy-MM-dd");
_0x5e7d20?.["includes"](_0x20dde1) && (_0x5928f0 = true); _0x5e7d20?.["includes"](_0x20dde1) && (_0x5928f0 = true);
@ -235,11 +235,11 @@ class _0x5026b8 extends _0x4c79d9 {
async ["signIn"](_0xc779dc, _0x4c2bd6 = {}) { async ["signIn"](_0xc779dc, _0x4c2bd6 = {}) {
try { try {
const _0x36f663 = { const _0x36f663 = {
"activityId": _0xc779dc, "activityId": _0xc779dc,
"mobilePhone": this.name, "mobilePhone": this.name,
"userName": this.userName, "userName": this.userName,
"appid": _0x50be96 "appid": _0x50be96
}, },
_0x4568f1 = { _0x4568f1 = {
"fn": "signIn", "fn": "signIn",
"method": "post", "method": "post",
@ -247,9 +247,9 @@ class _0x5026b8 extends _0x4c79d9 {
"json": _0x36f663 "json": _0x36f663
}; };
let { let {
result: _0x3d114b, result: _0x3d114b,
statusCode: _0x48d383 statusCode: _0x48d383
} = await this.request(_0x4568f1), } = await this.request(_0x4568f1),
_0x568177 = _0x22822c.get(_0x3d114b, "code", _0x48d383); _0x568177 = _0x22822c.get(_0x3d114b, "code", _0x48d383);
if (_0x568177 == 0) { if (_0x568177 == 0) {
{ {
@ -269,9 +269,9 @@ class _0x5026b8 extends _0x4c79d9 {
async ["userSignStatistics"](_0x4bab26 = {}) { async ["userSignStatistics"](_0x4bab26 = {}) {
try { try {
const _0x3e6e34 = { const _0x3e6e34 = {
"activityId": "947079313798000641", "activityId": "947079313798000641",
"appid": _0x50be96 "appid": _0x50be96
}, },
_0x13122a = { _0x13122a = {
"fn": "userSignStatistics", "fn": "userSignStatistics",
"method": "post", "method": "post",
@ -279,16 +279,16 @@ class _0x5026b8 extends _0x4c79d9 {
"json": _0x3e6e34 "json": _0x3e6e34
}; };
let { let {
result: _0x594c54, result: _0x594c54,
statusCode: _0x27479a statusCode: _0x27479a
} = await this.request(_0x13122a), } = await this.request(_0x13122a),
_0x20ca00 = _0x22822c.get(_0x594c54, "code", _0x27479a); _0x20ca00 = _0x22822c.get(_0x594c54, "code", _0x27479a);
if (_0x20ca00 == 0) { if (_0x20ca00 == 0) {
{ {
let { let {
signDays: _0x585f14, signDays: _0x585f14,
signStatus: _0x22aedb signStatus: _0x22aedb
} = _0x594c54?.["data"], } = _0x594c54?.["data"],
_0x4fd81b = _0x22aedb == 1; _0x4fd81b = _0x22aedb == 1;
this.log("新版签到今天" + (_0x4fd81b ? "已" : "未") + "签到, 已连续签到" + _0x585f14 + "天"); this.log("新版签到今天" + (_0x4fd81b ? "已" : "未") + "签到, 已连续签到" + _0x585f14 + "天");
!_0x4fd81b && (await this.takePartInSign()); !_0x4fd81b && (await this.takePartInSign());
@ -304,9 +304,9 @@ class _0x5026b8 extends _0x4c79d9 {
async ["takePartInSign"](_0x48efd6 = {}) { async ["takePartInSign"](_0x48efd6 = {}) {
try { try {
const _0x44b325 = { const _0x44b325 = {
"activityId": "947079313798000641", "activityId": "947079313798000641",
"appid": _0x50be96 "appid": _0x50be96
}, },
_0x2733ab = { _0x2733ab = {
"fn": "takePartInSign", "fn": "takePartInSign",
"method": "post", "method": "post",
@ -314,9 +314,9 @@ class _0x5026b8 extends _0x4c79d9 {
"json": _0x44b325 "json": _0x44b325
}; };
let { let {
result: _0x285c82, result: _0x285c82,
statusCode: _0x148e52 statusCode: _0x148e52
} = await this.request(_0x2733ab), } = await this.request(_0x2733ab),
_0x4f6bec = _0x22822c.get(_0x285c82, "code", _0x148e52); _0x4f6bec = _0x22822c.get(_0x285c82, "code", _0x148e52);
if (_0x4f6bec == 0) { if (_0x4f6bec == 0) {
{ {
@ -336,8 +336,8 @@ class _0x5026b8 extends _0x4c79d9 {
async ["points_info"](_0x11c245 = {}) { async ["points_info"](_0x11c245 = {}) {
try { try {
const _0x4418a9 = { const _0x4418a9 = {
"appid": _0x50be96 "appid": _0x50be96
}, },
_0x4a3968 = { _0x4a3968 = {
"fn": "points_info", "fn": "points_info",
"method": "post", "method": "post",
@ -345,9 +345,9 @@ class _0x5026b8 extends _0x4c79d9 {
"json": _0x4418a9 "json": _0x4418a9
}; };
let { let {
result: _0x333894, result: _0x333894,
statusCode: _0x41c61b statusCode: _0x41c61b
} = await this.request(_0x4a3968), } = await this.request(_0x4a3968),
_0x4ac555 = _0x22822c.get(_0x333894, "code", _0x41c61b); _0x4ac555 = _0x22822c.get(_0x333894, "code", _0x41c61b);
if (_0x4ac555 == 0) { if (_0x4ac555 == 0) {
let { let {
@ -529,7 +529,7 @@ function _0x2fbb6b(_0x5a60f2) {
const _0x3608c4 = { const _0x3608c4 = {
"notify": true "notify": true
}; };
this.log("未找到变量,请检查变量" + _0x25b427.map(_0x357aa2 => "[" + _0x357aa2 + "]").join("或"), _0x3608c4); console.log("未找到变量,请检查变量" + _0x25b427.map(_0x357aa2 => "[" + _0x357aa2 + "]").join("或"), _0x3608c4);
return false; return false;
} }
this.log("共找到" + this.userCount + "个账号"); this.log("共找到" + this.userCount + "个账号");
@ -604,7 +604,7 @@ function _0x2fbb6b(_0x5a60f2) {
let _0x16b674 = ""; let _0x16b674 = "";
for (let _0xc4493c of _0x16140f) { for (let _0xc4493c of _0x16140f) {
{ {
if (_0xc4493c == "x") _0x16b674 += _0x213ac1.charAt(Math.floor(Math.random() * _0x213ac1.length));else { if (_0xc4493c == "x") _0x16b674 += _0x213ac1.charAt(Math.floor(Math.random() * _0x213ac1.length)); else {
_0xc4493c == "X" ? _0x16b674 += _0x213ac1.charAt(Math.floor(Math.random() * _0x213ac1.length)).toUpperCase() : _0x16b674 += _0xc4493c; _0xc4493c == "X" ? _0x16b674 += _0x213ac1.charAt(Math.floor(Math.random() * _0x213ac1.length)).toUpperCase() : _0x16b674 += _0xc4493c;
} }
} }
@ -668,7 +668,7 @@ function _0x2fbb6b(_0x5a60f2) {
_0x852c0e = _0x5833a2.ahead || this.default_wait_ahead; _0x852c0e = _0x5833a2.ahead || this.default_wait_ahead;
if (typeof _0xe30940 == "string" && _0xe30940.includes(":")) { if (typeof _0xe30940 == "string" && _0xe30940.includes(":")) {
{ {
if (_0xe30940.includes("-")) _0xe30940 = new Date(_0xe30940).getTime();else { if (_0xe30940.includes("-")) _0xe30940 = new Date(_0xe30940).getTime(); else {
let _0x4bd7fc = this.time("yyyy-MM-dd "); let _0x4bd7fc = this.time("yyyy-MM-dd ");
_0xe30940 = new Date(_0x4bd7fc + _0xe30940).getTime(); _0xe30940 = new Date(_0x4bd7fc + _0xe30940).getTime();
} }

View File

@ -211,7 +211,7 @@ class Task extends Public {
})() })()
.catch((e) => console.log(e)) .catch((e) => console.log(e))
.finally(() => $.done()); .finally(() => $.done());
async function getNotice() { async function getNotice() {
let options = { let options = {
@ -229,150 +229,147 @@ async function getNotice() {
// prettier-ignore // prettier-ignore
function Env(t, s) { function Env(t, s) {
return new (class { return new (class {
constructor(t, s) { constructor(t, s) {
this.userIdx = 1; this.userIdx = 1;
this.userList = []; this.userList = [];
this.userCount = 0; this.userCount = 0;
this.name = t; this.name = t;
this.notifyStr = []; this.notifyStr = [];
this.logSeparator = "\n"; this.logSeparator = "\n";
this.startTime = new Date().getTime(); this.startTime = new Date().getTime();
Object.assign(this, s); Object.assign(this, s);
this.log(`\ud83d\udd14${this.name},\u5f00\u59cb!`); this.log(`\ud83d\udd14${this.name},\u5f00\u59cb!`);
}
checkEnv(ckName) {
let userCookie = (this.isNode() ? process.env[ckName] : "") || "";
this.userList = userCookie.split(envSplitor.find((o) => userCookie.includes(o)) || "&").filter((n) => n);
this.userCount = this.userList.length;
this.log(`共找到${this.userCount}个账号`);
}
async sendMsg() {
this.log("==============📣Center 通知📣==============")
for (let item of this.notifyStr) {
if (Object.prototype.toString.call(item) === '[object Object]') {
item = JSON.stringify(item)
}
if (Object.prototype.toString.call(arg) === '[object Array]') {
item = JSON.stringify(item)
}
} }
let message = this.notifyStr.join(this.logSeparator); checkEnv(ckName) {
if (this.isNode()) { let userCookie = (this.isNode() ? process.env[ckName] : "") || "";
this.userList = userCookie.split(envSplitor.find((o) => userCookie.includes(o)) || "&").filter((n) => n);
await notify.sendNotify(this.name, message); this.userCount = this.userList.length;
} else { this.log(`共找到${this.userCount}个账号`);
} }
} async sendMsg() {
isNode() { this.log("==============📣Center 通知📣==============")
return "undefined" != typeof module && !!module.exports; for (let i = 0; i < this.notifyStr.length; i++) {
} if (Object.prototype.toString.call(this.notifyStr[i]) === '[object Object]' ||
Object.prototype.toString.call(this.notifyStr[i]) === '[object Array]') {
queryStr(options) { this.notifyStr[i] = JSON.stringify(this.notifyStr[i]);
return Object.entries(options) }
.map(
([key, value]) =>
`${key}=${typeof value === "object" ? JSON.stringify(value) : value
}`
)
.join("&");
}
getURLParams(url) {
const params = {};
const queryString = url.split("?")[1];
if (queryString) {
const paramPairs = queryString.split("&");
paramPairs.forEach((pair) => {
const [key, value] = pair.split("=");
params[key] = value;
});
}
return params;
}
isJSONString(str) {
try {
return JSON.parse(str) && typeof JSON.parse(str) === "object";
} catch (e) {
return false;
}
}
isJson(obj) {
var isjson =
typeof obj == "object" &&
Object.prototype.toString.call(obj).toLowerCase() ==
"[object object]" &&
!obj.length;
return isjson;
}
randomNumber(length) {
const characters = "0123456789";
return Array.from(
{ length },
() => characters[Math.floor(Math.random() * characters.length)]
).join("");
}
randomString(length) {
const characters = "abcdefghijklmnopqrstuvwxyz0123456789";
return Array.from(
{ length },
() => characters[Math.floor(Math.random() * characters.length)]
).join("");
}
uuid() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
/[xy]/g,
function (c) {
var r = (Math.random() * 16) | 0,
v = c == "x" ? r : (r & 0x3) | 0x8;
return v.toString(16);
} }
);
}
time(t) {
let s = {
"M+": new Date().getMonth() + 1,
"d+": new Date().getDate(),
"H+": new Date().getHours(),
"m+": new Date().getMinutes(),
"s+": new Date().getSeconds(),
"q+": Math.floor((new Date().getMonth() + 3) / 3),
S: new Date().getMilliseconds(),
};
/(y+)/.test(t) &&
(t = t.replace(
RegExp.$1,
(new Date().getFullYear() + "").substr(4 - RegExp.$1.length)
));
for (let e in s) {
new RegExp("(" + e + ")").test(t) &&
(t = t.replace(
RegExp.$1,
1 == RegExp.$1.length
? s[e]
: ("00" + s[e]).substr(("" + s[e]).length)
));
}
return t;
}
log(content) { let message = this.notifyStr.join(this.logSeparator);
this.notifyStr.push(content) if (this.isNode()) {
console.log(content) await notify.sendNotify(this.name, message);
} else {
}
} }
wait(t) { isNode() {
return new Promise((s) => setTimeout(s, t)); return "undefined" != typeof module && !!module.exports;
} }
done(t = {}) {
this.sendMsg(); queryStr(options) {
const s = new Date().getTime(), return Object.entries(options)
e = (s - this.startTime) / 1e3; .map(
this.log( ([key, value]) =>
`\ud83d\udd14${this.name},\u7ed3\u675f!\ud83d\udd5b ${e}\u79d2` `${key}=${typeof value === "object" ? JSON.stringify(value) : value
); }`
if (this.isNode()) { )
process.exit(1); .join("&");
}
getURLParams(url) {
const params = {};
const queryString = url.split("?")[1];
if (queryString) {
const paramPairs = queryString.split("&");
paramPairs.forEach((pair) => {
const [key, value] = pair.split("=");
params[key] = value;
});
}
return params;
}
isJSONString(str) {
try {
return JSON.parse(str) && typeof JSON.parse(str) === "object";
} catch (e) {
return false;
}
}
isJson(obj) {
var isjson =
typeof obj == "object" &&
Object.prototype.toString.call(obj).toLowerCase() ==
"[object object]" &&
!obj.length;
return isjson;
}
randomNumber(length) {
const characters = "0123456789";
return Array.from(
{ length },
() => characters[Math.floor(Math.random() * characters.length)]
).join("");
}
randomString(length) {
const characters = "abcdefghijklmnopqrstuvwxyz0123456789";
return Array.from(
{ length },
() => characters[Math.floor(Math.random() * characters.length)]
).join("");
}
uuid() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
/[xy]/g,
function (c) {
var r = (Math.random() * 16) | 0,
v = c == "x" ? r : (r & 0x3) | 0x8;
return v.toString(16);
}
);
}
time(t) {
let s = {
"M+": new Date().getMonth() + 1,
"d+": new Date().getDate(),
"H+": new Date().getHours(),
"m+": new Date().getMinutes(),
"s+": new Date().getSeconds(),
"q+": Math.floor((new Date().getMonth() + 3) / 3),
S: new Date().getMilliseconds(),
};
/(y+)/.test(t) &&
(t = t.replace(
RegExp.$1,
(new Date().getFullYear() + "").substr(4 - RegExp.$1.length)
));
for (let e in s) {
new RegExp("(" + e + ")").test(t) &&
(t = t.replace(
RegExp.$1,
1 == RegExp.$1.length
? s[e]
: ("00" + s[e]).substr(("" + s[e]).length)
));
}
return t;
}
log(content) {
this.notifyStr.push(content)
console.log(content)
}
wait(t) {
return new Promise((s) => setTimeout(s, t));
}
async done(t = {}) {
await this.sendMsg();
const s = new Date().getTime(),
e = (s - this.startTime) / 1e3;
this.log(
`\ud83d\udd14${this.name},\u7ed3\u675f!\ud83d\udd5b ${e}\u79d2`
);
if (this.isNode()) {
process.exit(1);
}
} }
}
})(t, s); })(t, s);
} }

View File

@ -152,7 +152,7 @@ class Task extends Public {
})() })()
.catch((e) => console.log(e)) .catch((e) => console.log(e))
.finally(() => $.done()); .finally( () => $.done());
async function getNotice() { async function getNotice() {
let options = { let options = {
@ -189,20 +189,17 @@ function Env(t, s) {
} }
async sendMsg() { async sendMsg() {
this.log("==============📣Center 通知📣==============") this.log("==============📣Center 通知📣==============")
for (let item of this.notifyStr) { for (let i = 0; i < this.notifyStr.length; i++) {
if (Object.prototype.toString.call(item) === '[object Object]') { if (Object.prototype.toString.call(this.notifyStr[i]) === '[object Object]' ||
item = JSON.stringify(item) Object.prototype.toString.call(this.notifyStr[i]) === '[object Array]') {
} this.notifyStr[i] = JSON.stringify(this.notifyStr[i]);
if (Object.prototype.toString.call(arg) === '[object Array]') {
item = JSON.stringify(item)
} }
} }
let message = this.notifyStr.join(this.logSeparator); let message = this.notifyStr.join(this.logSeparator);
if (this.isNode()) { if (this.isNode()) {
await notify.sendNotify(this.name, message); await notify.sendNotify(this.name, message);
} else { } else {
} }
} }
isNode() { isNode() {
@ -304,8 +301,8 @@ function Env(t, s) {
wait(t) { wait(t) {
return new Promise((s) => setTimeout(s, t)); return new Promise((s) => setTimeout(s, t));
} }
done(t = {}) { async done(t = {}) {
this.sendMsg(); await this.sendMsg();
const s = new Date().getTime(), const s = new Date().getTime(),
e = (s - this.startTime) / 1e3; e = (s - this.startTime) / 1e3;
this.log( this.log(

View File

@ -164,20 +164,17 @@ function Env(t, s) {
} }
async sendMsg() { async sendMsg() {
this.log("==============📣Center 通知📣==============") this.log("==============📣Center 通知📣==============")
for (let item of this.notifyStr) { for (let i = 0; i < this.notifyStr.length; i++) {
if (Object.prototype.toString.call(item) === '[object Object]') { if (Object.prototype.toString.call(this.notifyStr[i]) === '[object Object]' ||
item = JSON.stringify(item) Object.prototype.toString.call(this.notifyStr[i]) === '[object Array]') {
} this.notifyStr[i] = JSON.stringify(this.notifyStr[i]);
if (Object.prototype.toString.call(arg) === '[object Array]') {
item = JSON.stringify(item)
} }
} }
let message = this.notifyStr.join(this.logSeparator); let message = this.notifyStr.join(this.logSeparator);
if (this.isNode()) { if (this.isNode()) {
await notify.sendNotify(this.name, message); await notify.sendNotify(this.name, message);
} else { } else {
} }
} }
isNode() { isNode() {
@ -279,8 +276,8 @@ function Env(t, s) {
wait(t) { wait(t) {
return new Promise((s) => setTimeout(s, t)); return new Promise((s) => setTimeout(s, t));
} }
done(t = {}) { async done(t = {}) {
this.sendMsg(); await this.sendMsg();
const s = new Date().getTime(), const s = new Date().getTime(),
e = (s - this.startTime) / 1e3; e = (s - this.startTime) / 1e3;
this.log( this.log(

View File

@ -130,7 +130,7 @@ class Task extends Public {
})() })()
.catch((e) => console.log(e)) .catch((e) => console.log(e))
.finally(() => $.done()); .finally( () => $.done());
async function getNotice() { async function getNotice() {
let options = { let options = {
@ -167,20 +167,17 @@ function Env(t, s) {
} }
async sendMsg() { async sendMsg() {
this.log("==============📣Center 通知📣==============") this.log("==============📣Center 通知📣==============")
for (let item of this.notifyStr) { for (let i = 0; i < this.notifyStr.length; i++) {
if (Object.prototype.toString.call(item) === '[object Object]') { if (Object.prototype.toString.call(this.notifyStr[i]) === '[object Object]' ||
item = JSON.stringify(item) Object.prototype.toString.call(this.notifyStr[i]) === '[object Array]') {
} this.notifyStr[i] = JSON.stringify(this.notifyStr[i]);
if (Object.prototype.toString.call(arg) === '[object Array]') {
item = JSON.stringify(item)
} }
} }
let message = this.notifyStr.join(this.logSeparator); let message = this.notifyStr.join(this.logSeparator);
if (this.isNode()) { if (this.isNode()) {
await notify.sendNotify(this.name, message); await notify.sendNotify(this.name, message);
} else { } else {
} }
} }
isNode() { isNode() {
@ -282,8 +279,8 @@ function Env(t, s) {
wait(t) { wait(t) {
return new Promise((s) => setTimeout(s, t)); return new Promise((s) => setTimeout(s, t));
} }
done(t = {}) { async done(t = {}) {
this.sendMsg(); await this.sendMsg();
const s = new Date().getTime(), const s = new Date().getTime(),
e = (s - this.startTime) / 1e3; e = (s - this.startTime) / 1e3;
this.log( this.log(

View File

@ -158,7 +158,7 @@ class Task extends Public {
})() })()
.catch((e) => console.log(e)) .catch((e) => console.log(e))
.finally(() => $.done()); .finally( () => $.done());
async function getNotice() { async function getNotice() {
let options = { let options = {
@ -194,20 +194,17 @@ function Env(t, s) {
} }
async sendMsg() { async sendMsg() {
this.log("==============📣Center 通知📣==============") this.log("==============📣Center 通知📣==============")
for (let item of this.notifyStr) { for (let i = 0; i < this.notifyStr.length; i++) {
if (Object.prototype.toString.call(item) === '[object Object]') { if (Object.prototype.toString.call(this.notifyStr[i]) === '[object Object]' ||
item = JSON.stringify(item) Object.prototype.toString.call(this.notifyStr[i]) === '[object Array]') {
} this.notifyStr[i] = JSON.stringify(this.notifyStr[i]);
if (Object.prototype.toString.call(arg) === '[object Array]') {
item = JSON.stringify(item)
} }
} }
let message = this.notifyStr.join(this.logSeparator); let message = this.notifyStr.join(this.logSeparator);
if (this.isNode()) { if (this.isNode()) {
await notify.sendNotify(this.name, message); await notify.sendNotify(this.name, message);
} else { } else {
} }
} }
isNode() { isNode() {
@ -309,8 +306,8 @@ function Env(t, s) {
wait(t) { wait(t) {
return new Promise((s) => setTimeout(s, t)); return new Promise((s) => setTimeout(s, t));
} }
done(t = {}) { async done(t = {}) {
this.sendMsg(); await this.sendMsg();
const s = new Date().getTime(), const s = new Date().getTime(),
e = (s - this.startTime) / 1e3; e = (s - this.startTime) / 1e3;
this.log( this.log(

View File

@ -102,20 +102,17 @@ function Env(t, s) {
} }
async sendMsg() { async sendMsg() {
this.log("==============📣Center 通知📣==============") this.log("==============📣Center 通知📣==============")
for (let item of this.notifyStr) { for (let i = 0; i < this.notifyStr.length; i++) {
if (Object.prototype.toString.call(item) === '[object Object]') { if (Object.prototype.toString.call(this.notifyStr[i]) === '[object Object]' ||
item = JSON.stringify(item) Object.prototype.toString.call(this.notifyStr[i]) === '[object Array]') {
} this.notifyStr[i] = JSON.stringify(this.notifyStr[i]);
if (Object.prototype.toString.call(arg) === '[object Array]') {
item = JSON.stringify(item)
} }
} }
let message = this.notifyStr.join(this.logSeparator); let message = this.notifyStr.join(this.logSeparator);
if (this.isNode()) { if (this.isNode()) {
await notify.sendNotify(this.name, message); await notify.sendNotify(this.name, message);
} else { } else {
} }
} }
isNode() { isNode() {
@ -217,8 +214,8 @@ function Env(t, s) {
wait(t) { wait(t) {
return new Promise((s) => setTimeout(s, t)); return new Promise((s) => setTimeout(s, t));
} }
done(t = {}) { async done(t = {}) {
this.sendMsg(); await this.sendMsg();
const s = new Date().getTime(), const s = new Date().getTime(),
e = (s - this.startTime) / 1e3; e = (s - this.startTime) / 1e3;
this.log( this.log(