页面树结构

版本比较

标识

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。

...

  • AES-GCM加密:smartbi.crypto.CryptoUtil.encrypt(tokenloginInfo, 密钥)。
  • DES加密:CryptoUtil.encrypt(AlgorithmType.DES, tokenloginInfo, 密钥)。

参考示例:

代码块
languagejs
linenumberstrue
//生成token
  String secretKey = "12345678";// 密钥
  Long timestamp =  new java.util.Date().getTime();// 必需是毫秒数的时间戳
  String userName = "admin";// 用户名
  String password = "admin";// 用户密码(可选)

  //token为json格式生成token	
  String token loginInfo= "{\"username\":\"" + userName + "\",\"password\":\"" + password + "\",\"timestamp\":" + timestamp + "}";
  String encryptedToken token	= null;
  try {
    encryptedTokentoken = CryptoUtil.encrypt(tokenloginInfo, secretKey);
	//如果选择使用使用des加密,使用接口: CryptoUtil.encrypt(AlgorithmType.DES,token, secretKey);
  } catch(Exception e) {
    //
  }

...

通过连接后加参数的方式传递:http://ip:port/smartbi/vision/loginByToken?smartbiToken=上一个章节生成的encryptedToken 上一章节生成的token&targetPath=目标跳转链接及其参数

链接格式解析

作用

ip:port

Smartbi系统服务器地址端口

smartbiToken 

2.2章节生成的令牌token。

信息
title注意

注意:token信息需要做encode转换,避免token中存在特殊字符导致令牌解密失败。

  • 在js代码中可使用encodeURIComponent转义,
  • java代码中可使用URLEncoder.encode("密文", "UTF-8") 转移


targetPath

目标跳转界面,当token校验结束后,直接重定向到该地址,只接受相对路径。

注意
若该参数值含有特殊符号,需要特殊处理,例如在js代码需要使用encodeURIComponent转义,java代码则需要URLEncoder.encode("密文", "UTF-8")


可选值描述附带其它参数示例
index.jspWeb端首页
openresource.jsp打开资源resid(资源id)targetPath=openresource.jsp?resid=I2c94ea86298cbe6c01298cfd9ba900fa
openmodule.jsp打开模块id,id的可选值参考:打开Smartbi模块targetPath=openmodule.jsp?id=Analysis&showbanner=false
createresource.jsp创建资源restype,可选值参考:新建Smartbi资源targetPath=createresource.jsp?restype=VISUAL
mobileX/index移动端首页targetPath=mobileX/index
mobileX/report打开移动端报表resid(资源id)targetPath=mobileX/report?resid=I2c94ea86298cbe6c01298cfd9ba900fa

















...