mirror of
https://github.com/smallfawn/QLScriptPublic.git
synced 2025-12-17 15:25:10 +08:00
Update qtx.js
This commit is contained in:
26
qtx.js
26
qtx.js
@@ -29,7 +29,7 @@ let userCount = 0;
|
|||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
|
||||||
async function start() {
|
async function start() {
|
||||||
await notice()
|
await getNotice()
|
||||||
console.log('\n============= 用户CK有效性验证 =============\n');
|
console.log('\n============= 用户CK有效性验证 =============\n');
|
||||||
taskall = [];
|
taskall = [];
|
||||||
for (let user of userList) {
|
for (let user of userList) {
|
||||||
@@ -300,15 +300,35 @@ function httpRequest(options, method) {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 获取远程版本
|
||||||
|
*/
|
||||||
|
function getVersion(scriptUrl, timeout = 3 * 1000) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
const options = { url: `https://fastly.jsdelivr.net/gh/${scriptUrl}` };
|
||||||
|
$.get(options, (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
const regex = /scriptVersionNow\s*=\s*(["'`])([\d.]+)\1/;
|
||||||
|
const match = data.match(regex);
|
||||||
|
const scriptVersionLatest = match ? match[2] : "";
|
||||||
|
console.log(`\n====== 当前版本:${scriptVersionNow} 📌 最新版本:${scriptVersionLatest} ======`);
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e, resp);
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
}, timeout);
|
||||||
|
});
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 获取远程通知
|
* 获取远程通知
|
||||||
*/
|
*/
|
||||||
async function getNotice() {
|
async function getNotice() {
|
||||||
try {
|
try {
|
||||||
const urls = [
|
const urls = [
|
||||||
|
"https://fastly.jsdelivr.net/gh/smallfawn/Note@main/Notice.json",
|
||||||
|
"https://gcore.jsdelivr.net/gh/smallfawn/Note@main/Notice.json",
|
||||||
"https://cdn.jsdelivr.net/gh/smallfawn/Note@main/Notice.json",
|
"https://cdn.jsdelivr.net/gh/smallfawn/Note@main/Notice.json",
|
||||||
"https://ghproxy.com/https://raw.githubusercontent.com/smallfawn/Note/main/Notice.json",
|
"https://ghproxy.com/https://raw.githubusercontent.com/smallfawn/Note/main/Notice.json",
|
||||||
"https://fastly.jsdelivr.net/gh/smallfawn/Note@main/Notice.json",
|
|
||||||
"https://gitee.com/smallfawn/Note/raw/master/Notice.json",
|
"https://gitee.com/smallfawn/Note/raw/master/Notice.json",
|
||||||
];
|
];
|
||||||
let notice = null;
|
let notice = null;
|
||||||
@@ -320,7 +340,7 @@ async function getNotice() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (notice) { DoubleLog(notice); }
|
if (notice) { $.DoubleLog(notice); }
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user