| <%@ page language="java" import="org.jasig.cas.client.authentication.AttributePrincipal" pageEncoding="UTF-8" %> | 
| <%@ page import="com.zt.zhpt.EncryptService" %> | 
| <%@ page import="java.net.URLEncoder" %> | 
| <%@ page import="sun.misc.BASE64Encoder" %> | 
| <% | 
|     AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal(); | 
|     String userId = principal.getName(); | 
|   | 
|     String tokenString = userId+"|#|"+System.currentTimeMillis(); | 
|     String password = "Edj&3G0L#sD"; // 参数 AES 加密密钥,若修改此变量值,请对应修改 starter\src\main\java\com\zt\security\controller\CasSsoController.java 对应的变量值 | 
|     byte[] encrypt = EncryptService.encrypt(tokenString, password); | 
|   | 
|     tokenString = new BASE64Encoder().encode(encrypt);// 加密后的Base64密文 | 
|     tokenString = URLEncoder.encode(tokenString, "UTF-8"); // URL 转码,防止作为参数挂到URL后面特殊符号的导致参数出错。 | 
|   | 
|     // 综合平台中用于接收单点登录参数的页面 | 
|     String url = "http://localhost:8001/#/auth"; | 
|   | 
|     response.sendRedirect(url+"?sso_token="+tokenString); | 
| %> | 
|   | 
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | 
| <html> | 
| <head> | 
|     <title>正在验证登录信息 . . .</title> | 
| </head> | 
|   | 
| <body> | 
| <div>欢迎</div> | 
| <ul> | 
|     <li>userId:<%= userId%></li> | 
| </ul> | 
| </body> | 
| </html>   |