Update mxbc.js

This commit is contained in:
smallfawn
2023-06-28 12:22:23 +08:00
committed by GitHub
parent e4cb5d3f5a
commit dffc88f636

45
mxbc.js
View File

@@ -31,7 +31,7 @@ let userCount = 0;
async function start() {
await notice()
await getNotice()
console.log('\n================== 用户CK ==================\n');
taskall = [];
for (let user of userList) {
@@ -207,28 +207,31 @@ function getSHA256withRSA(content) {
return sign64u;
}
async function notice() {
/**
* 获取远程通知
*/
async function getNotice() {
try {
let options = {
url: `https://ghproxy.com/https://raw.githubusercontent.com/smallfawn/api/main/notice.json`,
headers: {
'User-Agent': ''
},
}
//console.log(options);
let result = await httpRequest(options);
//console.log(result);
if (result) {
if ('notice' in result) {
DoubleLog(`${result.notice}`);
} else {
options.url = `https://gitee.com/smallfawn/api/raw/master/notice.json`
result = await httpRequest(options);
if ('notice' in result) {
DoubleLog(`${result.notice}`);
}
const urls = [
"https://ghproxy.com/https://raw.githubusercontent.com/smallfawn/Note/main/Notice.json",
"https://fastly.jsdelivr.net/gh/smallfawn/Note@main/Notice.json",
"https://cdn.jsdelivr.net/gh/smallfawn/Note@main/Notice.json",
"https://gitee.com/smallfawn/Note/raw/master/Notice.json"
];
let notice = null;
for (const url of urls) {
const options = {
url,
headers: { "User-Agent": "" }
};
const result = await httpRequest(options);
if (result && "notice" in result) {
notice = result.notice.replace(/\\n/g, '\n');
break;
}
} else {
}
if (notice) {
DoubleLog(notice);
}
} catch (e) {
console.log(e);