Commit e351f2c0 by wutong

CD/CI

parent ee55a21a
......@@ -17,57 +17,6 @@
$.ajaxSetup({
async: false
});
$(document).ready(function () {
var locationUrl = 'http://' + document.domain + '/index.html?md=index.md'
var cookie = $.cookie('token');
if (cookie && cookie != 'null') {
return;
}
var token = getParam('token');
if (token) {
$.ajax({
url: 'http://sso.bailuntec.com/GetTokenValidation',
headers: {
Authorization: token
},
type: "get",
beforeSend: function (xhr) {
xhr.setRequestHeader('Authorization', token);
},
success: function () {
$.cookie('token', token, {
expires: 1
});
window.location.replace(locationUrl);
},
error: function (error) {
console.log(error);
window.location.replace('http://sso.bailuntec.com/?returnUrl=http://' + document.domain);
}
});
} else {
$.cookie('token', token, {
expires: 1
});
window.location.replace('http://sso.bailuntec.com/?returnUrl=http://' + document.domain);
}
});
/**
* 获取指定的URL参数值
* URL:http://www.quwan.com/index?name=tyler
* 参数:paramName URL参数
* 调用方法:getParam("name")
* 返回值:tyler
*/
function getParam(paramName) {
paramValue = "", isFound = !1;
if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) {
arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"), i = 0;
while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() ==
paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++
}
return paramValue == "" && (paramValue = null), paramValue
}
</script>
</head>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment