统一的接口:

http://localhost:8075/WebReport/ReportServer?op=fs_load&cmd=sso&fr_username=XX&fr_password=XX

密码正确:

密码错误:

自定义登录html(AJAX实现):

<html>
<head>
<script type="text/javascript" src="ReportServer?op=emb&resource=finereport.js"></script>
<script type="text/javascript">
function doSubmit() {
var username = FR.cjkEncode(document.getElementById("username").value); //获取输入的用户名
var password = FR.cjkEncode(document.getElementById("password").value); //获取输入的参数
jQuery.ajax({
url:"http://localhost:8075/WebReport/ReportServer?op=fs_load&cmd=sso",//单点登录的管理平台报表服务器
dataType:"jsonp",//跨域采用jsonp方式
data:{"fr_username":username,"fr_password":password},//获取用户名密码
jsonp:"callback",
timeout:5000,//超时时间(单位:毫秒)
success:function(data) {
if (data.status === "success") {
window.location=data.url;//认证成功跳转页面,因为ajax不支持重定向所有需要跳转的设置
//登录成功
} else if (data.status === "fail"){
alert("用户名或密码错误");//登录失败(用户名或密码错误)
}
},
error:function(){
alert("超时或服务器其他错误");// 登录失败(超时或服务器其他错误)
}
});
}
</script>
</head>
<body>
<p>请登录</p>
<form name="login" method="POST">
<p>
用户名:
<input id="username" type="text" />
</p>
<p>
密 码:
<input id="password" type="password" />
</p>
<input type="button" value="登录" onclick="doSubmit()" />
</form>
</body>
</html>

iframe方式:

iframe方式单点登录的接口为:FR.servletURL + "?op=fs_load&cm=sso&fr_username=XX&fr_password=XX"
  var scr = document.createElement("iframe");      //创建iframe
scr.src = " http://localhost:8075/WebReport/ReportServer?op=fs_load&cm=sso&fr_username=" + username + "&fr_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中

报表action表单提交方式:

action中转向ReportServer,input元素则可看做多个参数自动拼url触发报表认证地址如:ReportServer?op=fs_load&cmd=sso&fr_username=" + username + "&fr_password=" + password。

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
</head>
<body>
<p> 请登录</p>
<form action="ReportServer" name="login" method="POST">
<input type="hidden" name="op" value="fs_load"></input>
<input type="hidden" name="cmd" value="sso"></input>
<p>用户名:<input type="username" name="username"></input></p>
<p>密码:<input type="password" name="password"></input></p>
<input type="submit" value="登录"></input>
</form>
</body>
</html>

FineReport——自定义登录页的更多相关文章

  1. Spring Security笔记:自定义登录页

    以下内容参考了 http://www.mkyong.com/spring-security/spring-security-form-login-example/ 接上回,在前面的Hello Worl ...

  2. Spring-Security自定义登录页&inMemoryAuthentication验证

    Spring Security是为基于Spring的应用程序提供声明式安全保护的安全性框架.框架下内容比较多,可以做到按照角色权限对请求路径进行限制.今天主要验证自定义登录页,在内存用户存储中进行请求 ...

  3. CAS4.0.4 之自定义登录页实践

    因最近公司要用到cas登陆而且要使用自定登陆页面,网络上搜索了一下cas自定义登陆,比较好的两篇文章CAS 之自定义登录页实践和CAS 之 跨域 Ajax 登录实践,感觉写的不错,但是发现改动的地方很 ...

  4. spring security采用自定义登录页和退出功能

    更新... 首先采用的是XML配置方式,请先查看  初识Spring security-添加security 在之前的示例中进行代码修改 项目结构如下: 一.修改spring-security.xml ...

  5. Spring Security教程(四):自定义登录页

    在前面的例子中,登陆页面都是用的Spring Security自己提供的,这明显不符合实际开发场景,同时也没有退出和注销按钮,因此在每次测试的时候都要通过关闭浏览器来注销达到清除session的效果. ...

  6. spring boot 下 spring security 自定义登录配置与form-login属性详解

    package zhet.sprintBoot; import org.springframework.beans.factory.annotation.Autowired;import org.sp ...

  7. spring security之 默认登录页源码跟踪

    spring security之 默认登录页源码跟踪 ​ 2021年的最后2个月,立个flag,要把Spring Security和Spring Security OAuth2的应用及主流程源码研究透 ...

  8. FineReport中如何自定义登录界面

    在登录平台时,不希望使用FR默认的内置登录界面,想通过自定义登录界面实现登录操作,内置登录界面如下图: 登录界面,获取到用户名和密码的值,发送到报表系统,报表服务带着这两个参数访问认证地址进行认证. ...

  9. CAS 4.0.x 自定义登录页面

    版权声明:本文为博主原创文章,未经博主允许不得转载.   目录(?)[-] CAS默认登录页面 复制一个新的页面管理页面 修改页面引用 修改casproperties 修改casLoginViewjs ...

随机推荐

  1. BZOJ3709 [PA2014]Bohater 【贪心】

    题目链接 BZOJ3709 题解 贪心很显然 我们先干掉能回血的怪,当然按照\(d\)升序顺序,因为打得越多血越多,\(d\)大的尽量往后打 然后再干掉会扣血的怪,当然按照\(a\)降序顺序,因为最后 ...

  2. UVA.540 Team Queue (队列)

    UVA.540 Team Queue (队列) 题意分析 有t个团队正在排队,每次来一个新人的时候,他可以插入到他最后一个队友的身后,如果没有他的队友,那么他只能插入到队伍的最后.题目中包含以下操作: ...

  3. HDOJ(HDU).4508 湫湫系列故事――减肥记I (DP 完全背包)

    HDOJ(HDU).4508 湫湫系列故事――减肥记I (DP 完全背包) 题意分析 裸完全背包 代码总览 #include <iostream> #include <cstdio& ...

  4. "HK"日常之冻结术

    在那遥远的MSDN上,有那么一只被隐藏的函数,它掌管着Windows内核威力不容小觑~ 本教程仅作为学习研究,禁止其他用途! 富强.民主.文明.和谐, 自由.平等.公正.法治, 爱国.敬业.诚信.友善 ...

  5. [zhuan]tomcat环境配置

    http://jingyan.baidu.com/article/8065f87fcc0f182330249841.html 一.安装JDK和Tomcat 1,安装JDK:直接运行jdk-7-wind ...

  6. Codeforces Round #169 (Div. 2) A水 B C区间更新 D 思路

    A. Lunch Rush time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...

  7. 【题解】Casting Spells LA 4975 UVa 1470 双倍回文 SDOI 2011 BZOJ 2342 Manacher

    首先要吐槽LRJ,书上给的算法标签是“有难度,需要结合其他数据结构”,学完Manacher才发现几乎一裸题 题目的意思是问原串中有多少个wwRwwR这样的子串,其中wR表示w的反串 比较容易看出来,w ...

  8. opencv学习笔记二

    1,读取照片(imread()) 2,处理照片(cvtcolor()) 3,命名窗口(namewindow()) 4,显示照片(imshow()) 5,保存照片(imwrite()) #include ...

  9. Python os.walk文件遍历

    os.walk(top, topdown=True, onerror=None, followlinks=False) 可以得到一个三元tupple(dirpath, dirnames, filena ...

  10. [Coding Practice] Maximum number of zeros in NxN matrix

    Question: Input is a NxN matrix which contains only 0′s and 1′s. The condition is no 1 will occur in ...