react项目中页面跳转、刷新及获取网络状态时间:2023-03-09 08:42:38 // 页面跳转 window.location.href = 'http://speedtest.wangxiaotong.com/' // 页面刷新 window.location.reload() // 获取当前网络状态,只能判断用户电脑有没有断网(包括无线和有线),有网为true,没有网为false navigator.onLine