mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
⚡ 检查互联网连通性时将 www.baidu.com 排在第一个
This commit is contained in:
parent
0e7f68114d
commit
346ce6edd0
2 changed files with 6 additions and 6 deletions
|
|
@ -1006,11 +1006,11 @@ powerMonitor.on('resume', async () => {
|
|||
writeLog('system resume')
|
||||
const isOnline = async () => {
|
||||
try {
|
||||
const result = await fetch('https://icanhazip.com', {timeout: 1000})
|
||||
const result = await fetch('https://www.baidu.com', {timeout: 1000})
|
||||
return 200 === result.status
|
||||
} catch (e) {
|
||||
try {
|
||||
const result = await fetch('https://www.baidu.com', {timeout: 1000})
|
||||
const result = await fetch('https://icanhazip.com', {timeout: 1000})
|
||||
return 200 === result.status
|
||||
} catch (e) {
|
||||
return false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue