统一的接口:

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. DFS染色解决区域分块问题UVALive 6663

    怪我比赛的时候想法太过于杂乱了. 注重于区域的属性了.甚至还想用状态压缩或者是hash来描述分块的区域. 其实我们的可以宏观的角度去审视这个问题.就是求分区的问题.那么我们完全可以标记边框的值为1.即 ...

  2. [洛谷P2408]不同子串个数

    题目大意:给你一个字符串,求其中本质不同的字串的个数 题解:同[洛谷P4070][SDOI2016]生成魔咒,只要最后再输出就行了 卡点:无 C++ Code: #include <cstdio ...

  3. 原 cocos2dx中毒冰冻shader

    #ifdef GL_ES precision mediump float; #endif uniform sampler2D u_texture; varying vec2 v_texCoord; v ...

  4. fhq_treap 学习笔记

    前言:昨天写NOIp2017队列,写+调辗转了3h+,不知道怎么的,就点进了一个神仙的链接,便在今日学习了神仙的fhq_treap. 简介:fhq_treap功能强大,支持splay支持的所有操作,代 ...

  5. bzoj2588: Spoj 10628. Count on a tree(树上第k大)(主席树)

    每个节点继承父节点的树,则答案为query(root[x]+root[y]-root[lca(x,y)]-root[fa[lca(x,y)]]) #include<iostream> #i ...

  6. 【DP】【P1586】四方定理

    传送门 Description Input 第一行为一个整数T代表数据组数,之后T行每行一个数n代表要被分解的数 Output 对于每个n输出一行,为方案个数 Sample Input Sample ...

  7. extjs gridpanel 操作行 得到选中行

    extjs gridpanel 操作行 得到选中行的列 在Extjs 3.2.0上适合 var model = grid.getSelectionModel(); model.selectAll(); ...

  8. 怎么使用formBuilder以拖拽方式编写页面

    1.以admin用户登录系统,打开formbuilder http://localhost:8081/framework/main/formbuilder 2.从右方组件中,用鼠标拖拽页面所需的组件到 ...

  9. Codeforces Round #202 (Div. 2) B,C,D,E

    贪心 B. Color the Fence time limit per test 2 seconds memory limit per test 256 megabytes input standa ...

  10. java线程的3种创建方式及优缺点

    线程创建简介 1.在java中表示线程的是Thread类.无论是那种方式创建线程,本质上都是创建Thread类的对象. 2.Thread类继承Runnable接口,且也有以Runnable作为参数的构 ...