hb_zhgd_screen/pages/safetyHat/index.html

74 lines
1.7 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<style>
html,
body {
width: 100%;
height: 100%;
}
body {
background-color: rgb(228, 228, 228);
overflow: hidden;
}
* {
margin: 0px;
padding: 0px;
}
.iframediv {
width: 100%;
height: 100%;
/* margin: 100px auto; */
/* border: 10px dashed rgb(58, 58, 58); */
overflow: hidden;
}
.iframediv iframe {
width: 100%;
height: 100%;
top: 0;
left: 0;
transform-origin: top left;
transform: scale(1)
}
</style>
<body>
<div class="iframediv">
<iframe id="iframe" allowfullscreen allow="microphone;camera;midi;encrypted-media;" ></iframe>
</div>
</body>
<script>
user_name="CS918F";
let url="https://caps.runde.pro/api/index.php?ctl=tool&act=get_pkey&user_name="+user_name+"&pwd=CS123456dl@";
let iframeUrl;
console.log(url);
var httpRequest = new XMLHttpRequest();
httpRequest.open('GET', url, false);
httpRequest.send();
console.log(httpRequest.responseText);
if (httpRequest.readyState == 4 && httpRequest.status == 200) {
var json = JSON.parse(httpRequest.responseText);
pkey=json.data;
var getTokenUrl="https://caps.runde.pro/api/index.php?ctl=tool&act=get_token&user_name="+user_name+"&pkey="+pkey
console.log(getTokenUrl);
httpRequest.open('GET', getTokenUrl, false);
httpRequest.send();
var json2 = JSON.parse(httpRequest.responseText);
iframeUrl="https://caps.runde.pro/login#token="+json2.session_id+"&user_name="+user_name+"&target=home";
console.log(iframeUrl);
document.getElementById("iframe").src=iframeUrl;
}else{
}
</script>
</html>