|
@@ -83,7 +83,7 @@ function ToolKit(scriptName, scriptId, options) {
|
|
|
initCache() {
|
|
initCache() {
|
|
|
const pKey = this.getPersistKey();
|
|
const pKey = this.getPersistKey();
|
|
|
if (this.isQuanX()) this.cache = JSON.parse($prefs.valueForKey(pKey) || "{}");
|
|
if (this.isQuanX()) this.cache = JSON.parse($prefs.valueForKey(pKey) || "{}");
|
|
|
- if (this.isLoon() || isSurge)
|
|
|
|
|
|
|
+ if (this.isLoon() || this.isSurge())
|
|
|
this.cache = JSON.parse($persistentStore.read(pKey) || "{}");
|
|
this.cache = JSON.parse($persistentStore.read(pKey) || "{}");
|
|
|
|
|
|
|
|
if (this.isNode()) {
|
|
if (this.isNode()) {
|
|
@@ -539,7 +539,7 @@ function ToolKit(scriptName, scriptId, options) {
|
|
|
if (this.isEnableLog) {
|
|
if (this.isEnableLog) {
|
|
|
console.log(`${this.logSeparator}${this.name}执行异常:`)
|
|
console.log(`${this.logSeparator}${this.name}执行异常:`)
|
|
|
console.log(message)
|
|
console.log(message)
|
|
|
- console.log(`\n${message.message}`)
|
|
|
|
|
|
|
+ console.log('\n'+`${message.message}`)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -565,7 +565,7 @@ function ToolKit(scriptName, scriptId, options) {
|
|
|
message = message.replace(key, this.tgEscapeCharMapping[key])
|
|
message = message.replace(key, this.tgEscapeCharMapping[key])
|
|
|
}
|
|
}
|
|
|
this.get({
|
|
this.get({
|
|
|
- url: encodeURI(`${this.tgNotifyUrl}📌${this.name}\n${message}`)
|
|
|
|
|
|
|
+ url: encodeURI(`${this.tgNotifyUrl}📌${this.name}`+'\n'+`${message}`)
|
|
|
}, (_error, _statusCode, _body) => {
|
|
}, (_error, _statusCode, _body) => {
|
|
|
this.log(`Tg通知完毕`)
|
|
this.log(`Tg通知完毕`)
|
|
|
})
|
|
})
|
|
@@ -847,7 +847,7 @@ function ToolKit(scriptName, scriptId, options) {
|
|
|
* @returns {*}
|
|
* @returns {*}
|
|
|
*/
|
|
*/
|
|
|
autoComplete(str, prefix, suffix, fill, len, direction, ifCode, clen, startIndex, cstr) {
|
|
autoComplete(str, prefix, suffix, fill, len, direction, ifCode, clen, startIndex, cstr) {
|
|
|
- str += ``
|
|
|
|
|
|
|
+ str += ''
|
|
|
if (str.length < len) {
|
|
if (str.length < len) {
|
|
|
while (str.length < len) {
|
|
while (str.length < len) {
|
|
|
if (direction == 0) {
|
|
if (direction == 0) {
|
|
@@ -858,7 +858,7 @@ function ToolKit(scriptName, scriptId, options) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (ifCode) {
|
|
if (ifCode) {
|
|
|
- let temp = ``
|
|
|
|
|
|
|
+ let temp = ''
|
|
|
for (var i = 0; i < clen; i++) {
|
|
for (var i = 0; i < clen; i++) {
|
|
|
temp += cstr
|
|
temp += cstr
|
|
|
}
|
|
}
|