You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
3.3 KiB
97 lines
3.3 KiB
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
|
|
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-store, must-revalidate">
|
|
<meta HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 01:01:01 GMT">
|
|
<meta HTTP-EQUIV="expires" CONTENT="0">
|
|
<title>载入中...</title>
|
|
<style>
|
|
html{
|
|
height:100%;
|
|
}
|
|
body{
|
|
height:100%;
|
|
}
|
|
.Center-Container {
|
|
background-color: #35A9FE;
|
|
position: relative;
|
|
}
|
|
|
|
.Absolute-Center {
|
|
width: 20%;
|
|
height: 50%;
|
|
overflow: auto;
|
|
margin: auto;
|
|
position: absolute;
|
|
top: 0; left: 0; bottom: 0; right: 0;
|
|
}
|
|
</style>
|
|
<script src="./lib/blueimp-md5/md5.js"></script>
|
|
<script src="./lib/axios/axios.min.js"></script>
|
|
</head>
|
|
<body class="Center-Container">
|
|
<img src="loading.svg?v=202004211141" class="Absolute-Center" />
|
|
<p style="display:block;position:absolute;text-align:center;padding:30px;color:#FFF;">Version 202009010853</p>
|
|
</body>
|
|
<script>
|
|
/**
|
|
* [通过参数名获取url中的参数值]
|
|
* 示例URL:http://iot.edusoa.com/IoTCenter/index.html?organname=测试学校
|
|
* @param {[string]} queryName [参数名]
|
|
* @return {[string]} [参数值]
|
|
*/
|
|
function GetQueryValue(queryName) {
|
|
var reg = new RegExp("(^|&)" + queryName + "=([^&]*)(&|$)", "i");
|
|
var r = window.location.search.substr(1).match(reg);
|
|
if ( r != null ){
|
|
return decodeURIComponent(r[2]);
|
|
}else{
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* username 账号
|
|
* realname 姓名
|
|
* organname 机构(教育局/学校)
|
|
* organnumber 机构代码(教育局/学校)
|
|
* token 令牌
|
|
* timestamp 级时间戳(秒)
|
|
* role 角色列表
|
|
*/
|
|
|
|
var baseUrl= "http://221.194.113.154:8100/IoTCenter/api/v1/Project/Update";
|
|
var timestamp = parseInt(new Date().getTime() / 1000); // 秒级时间戳
|
|
// var query = "username=cuishuying&realname="+encodeURIComponent('崔淑英')+"&organname="+encodeURIComponent('唐山市税东中学')+"&organnumber=1234567×tamp=" +timestamp+ "&role=" + encodeURIComponent('市级管理员,区管理员');
|
|
var query = "username=" +GetQueryValue('username')+ "&realname="+encodeURIComponent(GetQueryValue('realname'))+"&organname="+encodeURIComponent(GetQueryValue('organname'))+"&organnumber=" +GetQueryValue('organnumber')+ "×tamp=" +GetQueryValue('timestamp')+ "&role=" + encodeURIComponent(GetQueryValue('role'));
|
|
|
|
// console.log(GetQueryValue('role'));
|
|
|
|
/*
|
|
* 算法 MD5盐值 salt=123456
|
|
* https://cdn.bootcdn.net/ajax/libs/blueimp-md5/2.16.0/js/md5.js
|
|
*/
|
|
|
|
var token = GetQueryValue('token');
|
|
|
|
var url = baseUrl + "?" + query + "&token=" + token;
|
|
// alert(url);
|
|
var api_url = "http://221.194.113.154:8100/IoTCenter/api/v1/Project/Update" + "?" + query + "&token=" + token;
|
|
axios.get(api_url).then(function (response) {
|
|
console.log(response);
|
|
if(response.data.accessToken){
|
|
localStorage.setItem('accessToken', response.data.accessToken);
|
|
localStorage.setItem('refreshToken', response.data.refreshToken);
|
|
var secScript = document.createElement("script");
|
|
secScript.setAttribute("type", "text/javascript");
|
|
secScript.setAttribute("src", 'redirect.js?v=' + new Date().toLocaleTimeString());
|
|
document.body.insertBefore(secScript, document.body.lastChild);
|
|
}else{
|
|
window.location.href="/400.html?v=3"
|
|
}
|
|
});
|
|
|
|
</script>
|
|
</html> |