This commit is contained in:
smallfawn
2025-03-09 20:30:49 +08:00
parent 895a6e2a02
commit 1b086b4af0
7 changed files with 58 additions and 2 deletions

View File

@@ -205,6 +205,14 @@ function Env(t, s) {
} }
async sendMsg() { async sendMsg() {
this.log("==============📣Center 通知📣==============") 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 = item.join(this.logSeparator)
}
}
let message = this.notifyStr.join(this.logSeparator); let message = this.notifyStr.join(this.logSeparator);
if (this.isNode()) { if (this.isNode()) {

View File

@@ -248,14 +248,22 @@ function Env(t, s) {
} }
async sendMsg() { async sendMsg() {
this.log("==============📣Center 通知📣==============") 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 = item.join(this.logSeparator)
}
}
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() {
return "undefined" != typeof module && !!module.exports; return "undefined" != typeof module && !!module.exports;
} }

View File

@@ -189,6 +189,14 @@ function Env(t, s) {
} }
async sendMsg() { async sendMsg() {
this.log("==============📣Center 通知📣==============") 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 = item.join(this.logSeparator)
}
}
let message = this.notifyStr.join(this.logSeparator); let message = this.notifyStr.join(this.logSeparator);
if (this.isNode()) { if (this.isNode()) {

View File

@@ -164,6 +164,14 @@ function Env(t, s) {
} }
async sendMsg() { async sendMsg() {
this.log("==============📣Center 通知📣==============") 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 = item.join(this.logSeparator)
}
}
let message = this.notifyStr.join(this.logSeparator); let message = this.notifyStr.join(this.logSeparator);
if (this.isNode()) { if (this.isNode()) {

View File

@@ -167,6 +167,14 @@ function Env(t, s) {
} }
async sendMsg() { async sendMsg() {
this.log("==============📣Center 通知📣==============") 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 = item.join(this.logSeparator)
}
}
let message = this.notifyStr.join(this.logSeparator); let message = this.notifyStr.join(this.logSeparator);
if (this.isNode()) { if (this.isNode()) {

View File

@@ -194,6 +194,14 @@ function Env(t, s) {
} }
async sendMsg() { async sendMsg() {
this.log("==============📣Center 通知📣==============") 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 = item.join(this.logSeparator)
}
}
let message = this.notifyStr.join(this.logSeparator); let message = this.notifyStr.join(this.logSeparator);
if (this.isNode()) { if (this.isNode()) {

View File

@@ -102,6 +102,14 @@ function Env(t, s) {
} }
async sendMsg() { async sendMsg() {
this.log("==============📣Center 通知📣==============") 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 = item.join(this.logSeparator)
}
}
let message = this.notifyStr.join(this.logSeparator); let message = this.notifyStr.join(this.logSeparator);
if (this.isNode()) { if (this.isNode()) {