mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
🎨 支持配置网络连通性判断 URL https://github.com/siyuan-note/siyuan/issues/7805
This commit is contained in:
parent
42dc3712c1
commit
bec14bf7db
1 changed files with 6 additions and 1 deletions
|
|
@ -953,10 +953,15 @@ powerMonitor.on("resume", async () => {
|
||||||
try {
|
try {
|
||||||
const result = await fetch("https://icanhazip.com", {timeout: 1000});
|
const result = await fetch("https://icanhazip.com", {timeout: 1000});
|
||||||
return 200 === result.status;
|
return 200 === result.status;
|
||||||
|
} catch (e) {
|
||||||
|
try {
|
||||||
|
const result = await fetch("https://api.ipify.org", {timeout: 1000});
|
||||||
|
return 200 === result.status;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
let online = false;
|
let online = false;
|
||||||
for (let i = 0; i < 7; i++) {
|
for (let i = 0; i < 7; i++) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue