1. 概述
1.1 版本
報表服務器版本 | JAR 包 | 插件版本 |
---|---|---|
10.0 | 2019-05-20 | 1.0 |
1.2 功能簡介
URL登錄插件 用於直接使用get請求拼接用戶名,密碼,保持登錄,跳轉 URL 四個參數,進行登錄并跳轉。
注:如果開啓了短信驗證等,則會抛出對應的錯誤碼,此時無法通過此插件登錄。
1.3 參數簡介
GET /url/login
參數 | 類型 | 說明 |
---|---|---|
fine_username | RequestParam 參數 | 用戶名 |
fine_password | RequestParam 參數 | 密碼 |
validity | RequestParam 參數 | 保存登錄 -2 記住密碼(默認 14 天); -1 關閉浏覽器清除; 大於 0 爲具體時間,單位秒 |
origin | RequestParam 參數 | 跳轉 URL 如果 origin 參數爲空,則跳轉到首頁。 |
2. 示例
2.1 安裝插件
點擊下載插件:URL登錄插件
設計器插件安裝方法參照 設計器插件管理
服務器安裝插件方法參照 服務器插件管理
2.2 登錄示例
工程路徑 webroot,servlet 路徑 decision,請求 http://localhost:8075/webroot/decision
後面拼接 |
---|
/url/login? |
fine_username=Alice |
fine_password=123456 |
validity=-1 |
origin=跳轉URL,origin 參數的内容需要使用 base64轉碼 |
2.2.1 orgin 參數爲空,直接登錄首頁
http://localhost:8075/webroot/decision/url/login?fine_username=Alice&fine_password=123456&validity=-1
2.2.2 orgin 參數不爲空,跳轉訪問 finereport.frm 模板
1)跳轉的 URL 爲:http://localhost:8075/webroot/decision/view/form?viewlet=demo/homepage/finereport.frm
注:若訪問模板路徑中包含中文,需要先對模板路徑做 URLEncode 編碼
2)跳轉 URL base64轉碼 後:aHR0cDovL2xvY2FsaG9zdDo4MDc1L3dlYnJvb3QvZGVjaXNpb24vdmlldy9mb3JtP3ZpZXdsZXQ9ZGVtby9ob21lcGFnZS9maW5lcmVwb3J0LmZybQ==
3)拼接後到 &origin= 後面,最終 URL 爲:
http://localhost:8075/webroot/decision/url/login?fine_username=Alice&fine_password=123456&validity=-1&origin=aHR0cDovL2xvY2FsaG9zdDo4MDc1L3dlYnJvb3QvZGVjaXNpb24vdmlldy9mb3JtP3ZpZXdsZXQ9ZGVtby9ob21lcGFnZS9maW5lcmVwb3J0LmZybQ==
注:若訪問模板如果提示無權限,需要注意是否開啓了 模板認證