软测单独项目
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.

96 lines
3.8 KiB

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="/js/jquery-2.1.3.min.js"></script>
<script type="text/javascript">
$(function () {
function getCode(url, codeKey, typ) {
try {
$.ajax({
url: "https://xzdj.xfzn365.com/political/mobile/getJwtBase64?usersUid=" + codeKey, success: function (result) {
//console.log(result);
var codeStr = result + '';
//window.location.href = url + codeStr + "&url=http://xzcamp.xfzn365.com/FengHuoServicePage.html?typ=" + typ;
var urlStr = url + codeStr + "&url=http://xzcamp.xfzn365.com/FengHuoServicePage.html?typ=" + typ;
console.log(urlStr);
window.location.href = urlStr;
//console.log(encodeURIComponent(result));
}
, error: function (xhr, status, error) {
if (xhr.status === 0) {
// 网络连接失败
console.log("网络连接失败,请检查网络是否正常");
} else {
// 请求出现其他错误
console.log("ajax请求错误:" + error);
}
}
});
} catch (ex) {
}
}
function getParameterByName(name) {
name = name.replace(/[\[\]]/g, "\\$&");
var url = window.location.href;
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return '';
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
function init() {
var typ = getParameterByName("typ");
var code = getParameterByName("code");
if (code.length < 1) {
try {
code = JSON.parse(window.sessionStorage.getItem("userInfo")).UserCode;
} catch (ex) { }
}
//var codeKey = getCode(code);
//alert(codeKey);
switch (typ) {
//心理健康
case "1":
// window.location.href = "http://121.36.201.30:9533?jwt=" + codeKey + "&url=http://xzcamp.xfzn365.com/FengHuoServicePage.html?typ=1";
getCode("http://121.36.201.30:9533?jwt=", code, "1");
break;
//演练
case "2":
//window.location.href = "http://121.36.201.30:9422?jwt=" + codeKey + "&url=http://xzcamp.xfzn365.com/FengHuoServicePage.html?typ=2";
getCode("http://121.36.201.30:9422?jwt=", code, "2");
break;
//直播
case "3":
//window.location.href = "http://121.36.201.30:9426?jwt=" + codeKey + "&url=http://xzcamp.xfzn365.com/FengHuoServicePage.html?typ=3";
getCode("http://121.36.201.30:9426?jwt=", code, "3");
break;
default:
//window.location.href = "http://www.baidu.com";
$("#h1Html").html("参数错误!");
break;
}
}
init();
});
</script>
</head>
<body>
<h1 id="h1Html">加载中……</h1>
</body>
</html>