This commit is contained in:
@@ -390,15 +390,24 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await new Promise((resolve) => {
|
// #ifndef H5
|
||||||
uni.showModal({
|
const [err, res] = await uni.getConnectedWifi();
|
||||||
title: '提示',
|
if (!err && res && res.wifi) {
|
||||||
content: '请先连接设备WiFi,否则无法访问后台管理',
|
const currentIP = res.wifi.localIp || '';
|
||||||
showCancel: false,
|
const lanIP = deviceInfo.lan_ip.replace('http://', '').replace('https://', '').split(':')[0];
|
||||||
buttonText: '我知道了',
|
const lanIPPrefix = lanIP.split('.').slice(0, 3).join('.');
|
||||||
success: () => resolve()
|
const currentIPPrefix = currentIP.split('.').slice(0, 3).join('.');
|
||||||
});
|
if (currentIPPrefix !== lanIPPrefix && lanIPPrefix !== '0.0.0') {
|
||||||
});
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请先连接设备WiFi,否则无法访问后台管理',
|
||||||
|
cancelText: '取消',
|
||||||
|
confirmText: '我知道了'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
// 跳转到设备后台管理地址
|
// 跳转到设备后台管理地址
|
||||||
const url = deviceInfo.lan_ip.startsWith('http') ? deviceInfo.lan_ip : `http://${deviceInfo.lan_ip}`;
|
const url = deviceInfo.lan_ip.startsWith('http') ? deviceInfo.lan_ip : `http://${deviceInfo.lan_ip}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user