fix: 网关设备-远程控制兼容https

* fix: bug网关设备跳转

* fix: bug网关设备跳转
This commit is contained in:
qiaochuLei 2023-08-17 18:14:11 +08:00 committed by GitHub
parent dd0cd666dc
commit bfff1c3215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -20,9 +20,12 @@ watch(
deviceId.value = newId as string;
_control(newId).then((resp: any) => {
if (resp.status === 200) {
const protocol = location.protocol
const item = `${protocol}//${resp.result?.url}/#/login?token=${resp.result.token}`;
url.value = item;
const item = `http://${resp.result?.url}/#/login?token=${resp.result.token}`;
if(window.location.protocol === 'https:' && item){
window.open(item)
}else{
url.value = item;
}
}
});
}