iframe方式
iframe方式单点登录的接口为:
FR.servletURL + "?op=fs_load&cm=sso&username=XX&password=XX",
var scr = document.createElement("iframe"); //创建iframe
scr.src = " http://localhost:8075/WebReport/ReportServer?op=fs_load&cm=sso&username=" + username + "&password=" + password; //将报表验证用户名密码的地址指向此iframe
if (scr.attachEvent){ //判断是否为ie浏览器
scr.attachEvent("onload", function(){ //如果为ie浏览器则页面加载完成后立即执行
window.location=" http://localhost:8075/WebReport/ReportServer?op=fs"; //直接跳转到数据决策系统
});
} else {
scr.onload = function(){ //其他浏览器则重新加载onload事件
window.location=" http://localhost:8075/WebReport/ReportServer?op=fs"; //直接跳转到数据决策系统
};
}
document.getElementsByTagName("head")[0].appendChild(scr); //将iframe标签嵌入到head中