提交 40bd90d0 编写于 作者: Z zhourui

cookie delete as anonymous

上级 8df8fd25
......@@ -160,16 +160,6 @@
"allowList": [],
"dentyList": []
},
{
"name": "File",
"path": "File",
"title": "云文件",
"iconPath": "appicon.png",
"orderNumber": 16.0,
"type": "system",
"allowList": [],
"dentyList": []
},
{
"name": "Note",
"path": "Note",
......@@ -190,16 +180,6 @@
"allowList": [],
"dentyList": []
},
{
"name": "OnlineMeeting",
"path": "OnlineMeeting",
"title": "网络会议",
"iconPath": "appicon.png",
"orderNumber": 19.0,
"type": "system",
"allowList": [],
"dentyList": []
},
{
"name": "Attendance",
"path": "Attendance",
......
......@@ -32,6 +32,7 @@ public class HttpToken {
public static final String X_Person = "x-person";
public static final String X_Client = "x-client";
public static final String X_Debugger = "x-debugger";
public static final String COOKIE_ANONYMOUS_VALUE = "anonymous";
private static final String RegularExpression_IP = "([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}";
private static final String RegularExpression_Token = "^(anonymous|user|manager|cipher)([2][0][1-2][0-9][0-1][0-9][0-3][0-9][0-5][0-9][0-5][0-9][0-5][0-9])(\\S{1,})$";
......@@ -44,11 +45,6 @@ public class HttpToken {
// 加入调试标记
Object debugger = request.getHeader(HttpToken.X_Debugger);
effectivePerson.setDebugger((null != debugger) && BooleanUtils.toBoolean(Objects.toString(debugger)));
// if (null != debugger && BooleanUtils.toBoolean(Objects.toString(debugger))) {
// effectivePerson.setDebugger(true);
// } else {
// effectivePerson.setDebugger(false);
// }
setAttribute(request, effectivePerson);
setToken(request, response, effectivePerson);
return effectivePerson;
......@@ -100,7 +96,10 @@ public class HttpToken {
public void deleteToken(HttpServletRequest request, HttpServletResponse response) throws Exception {
try {
String cookie = X_Token + "=; path=/; domain=" + this.domain(request) + "; max-age=0";
// String cookie = X_Token + "=anonymous; path=/; domain=" +
// this.domain(request) + "; max-age=0
String cookie = X_Token + "=" + COOKIE_ANONYMOUS_VALUE + "; path=/; domain=" + this.domain(request)
+ "; HttpOnly";
response.setHeader("Set-Cookie", cookie);
} catch (Exception e) {
throw new Exception("delete Token cookie error.", e);
......@@ -111,7 +110,6 @@ public class HttpToken {
throws Exception {
switch (effectivePerson.getTokenType()) {
case anonymous:
// this.deleteToken(request, response);
break;
case user:
this.setResponseToken(request, response, effectivePerson);
......@@ -130,20 +128,21 @@ public class HttpToken {
private void setResponseToken(HttpServletRequest request, HttpServletResponse response,
EffectivePerson effectivePerson) throws Exception {
if (!StringUtils.isEmpty(effectivePerson.getToken())) {
String cookie = X_Token + "=" + effectivePerson.getToken() + "; path=/; domain=" + this.domain(request);
String cookie = X_Token + "=" + effectivePerson.getToken() + "; path=/; domain=" + this.domain(request)
+ "; HttpOnly";
response.setHeader("Set-Cookie", cookie);
response.setHeader(X_Token, effectivePerson.getToken());
}
}
public void setResponseToken(HttpServletRequest request, HttpServletResponse response, String tokenName,
String token) throws Exception {
if (!StringUtils.isEmpty(token)) {
String cookie = tokenName + "=" + token + "; path=/; domain=" + this.domain(request);
response.setHeader("Set-Cookie", cookie);
response.setHeader(tokenName, token);
}
}
// public void setResponseToken(HttpServletRequest request, HttpServletResponse response, String tokenName,
// String token) throws Exception {
// if (!StringUtils.isEmpty(token)) {
// String cookie = tokenName + "=" + token + "; path=/; domain=" + this.domain(request) + "; HttpOnly";
// response.setHeader("Set-Cookie", cookie);
// response.setHeader(tokenName, token);
// }
// }
public String getToken(HttpServletRequest request) throws Exception {
String token = null;
......
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<script src="./jquery.min.js"></script>
<script src="./clipboard.min.js"></script>
<style type="text/css">
<!--
body {
font-family: Arial, Helvetica, sans-serif;
font-size:12px;
color:#666666;
background:#fff;
text-align:left;
}
a {
color:#1E7ACE;
text-decoration:none;
}
a:hover {
color:#000;
text-decoration:underline;
}
h3 {
font-size:14px;
font-weight:bold;
}
pre,p {
color:#1E7ACE;
margin:4px;
}
input, select,textarea {
padding:1px;
margin:2px;
font-size:11px;
}
fieldset {
padding:10px;
margin-top:10px;
border:1px solid #A4CDF2;
background:#fff;
}
fieldset legend {
color:#1E7ACE;
font-weight:bold;
padding:3px 20px 3px 20px;
border:1px solid #A4CDF2;
background:#fff;
}
input {
border:1px solid #A4CDF2;
}
button {
border:1px solid #A4CDF2;
background-color : #FFFFFF;
height:25px;
margin-top:10px;
font-weight:bold;
color:#1E7ACE;
}
-->
</style>
<script>
var describe;
$.getScript('./describe.js?rd=' + Math.random()).then(function() {
describe = new Describe();
describe.load();
}).catch( function() {
alert('get describe error.');
});
$(document).ready(function(){
var clipboard = new Clipboard("#btn_copy");
$('#butSearch').click(function() {
var strKey = $('#inpSearch').val();
if(strKey == ""){
window.location.reload();
}else{
describe.search(strKey);
}
})
$('#inpSearch').bind('keyup', function(event) {
   if (event.keyCode == "13") {
     $('#butSearch').click();
   }
});
});
</script>
</head>
<meta charset="UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<script src="./jquery.min.js"></script>
<script src="./common.js"></script>
<style type="text/css">
<!--
body {
font-family: Arial, Helvetica, sans-serif;
font-size:12px;
color:#666666;
background:#fff;
text-align:left;
}
a {
color:#1E7ACE;
text-decoration:none;
}
a:hover {
color:#000;
text-decoration:underline;
}
h3 {
font-size:14px;
font-weight:bold;
}
pre,p {
color:#1E7ACE;
margin:4px;
}
table {
border-collapse: collapse;
margin: 0 auto;
text-align: left;
}
table td, table th {
border: 1px solid #cad9ea;
color: #666;
height: 30px;
padding-left:20px;
padding-right:60px;
}
table thead th {
background-color: #CCE8EB;
width: 100px;
}
table tr:nth-child(odd) {
background: #fff;
}
<body style="font-size: 12px; font-family: Microsoft Yahei; margin: 0px;border-image: linear-gradient(#ffffff, #e7e7e7 15%, #e7e7e7 100%, #ffffff);box-shadow: inset 15px 0 5px -16px #e7e7e7;background-image: -webkit-radial-gradient(right, #f2f2f2, #ffffff 100%);">
<table style="width: 1800px; margin: 0 auto">
<tr>
<td style="width: 350px;" valign="top">
<fieldset>
<legend>search</legend>
<div><input id="inpSearch" style="width:70%;height: 23px; overflow: auto;"/>&nbsp; <button id="butSearch">search</button></div>
</fieldset>
<fieldset>
<legend>API Menu</legend>
<div id="menu" style="height: 850px; overflow: auto;">&nbsp;</div>
</fieldset>
</td>
<td valign="top">
<!--<fieldset>
<legend>Content</legend>
<div id="content"
style="white-space: pre; font-size: 12px; word-break: break-all; word-wrap: break-word">&nbsp;</div>
</fieldset> -->
<div id="content"
style="white-space: pre; font-size: 12px; word-break: break-all; word-wrap: break-word;border-image: linear-gradient(#ffffff, #e7e7e7 15%, #e7e7e7 100%, #ffffff);box-shadow: inset 15px 0 5px -16px #e7e7e7;background-image: -webkit-radial-gradient(right, #f2f2f2, #ffffff 100%);">&nbsp;</div>
<fieldset>
<legend>
Result&nbsp;<a id="btn_copy" href="javascript:" data-clipboard-target="#result">copy</a>&nbsp;
</legend>
<div id="result"
style="white-space: pre; font-size: 12px; word-break: break-all; word-wrap: break-word; width: 1400px">&nbsp;</div>
</fieldset>
<fieldset>
<legend>
Sample&nbsp;<a id="btn_copy" href="javascript:" data-clipboard-target="#Sample">copy</a>&nbsp;
</legend><div style="padding-left:12px">
<div id="Sample"
style="white-space: pre; font-size: 12px; word-break: break-all; word-wrap: break-word; width: 1400px;">&nbsp;</div>
</div>
</fieldset>
table tr:nth-child(even) {
background: #F5FAFA;
}
-->
</style>
<script>
function tableStructure(){
var entityMap = new Map();
entityMap.set("x_attendance_core_entity", "考勤相关");
entityMap.set("x_bbs_core_entity", "论坛相关");
entityMap.set("x_calendar_core_entity", "日程管理相关");
entityMap.set("x_cms_core_entity", "内容管理相关");
entityMap.set("x_component_core_entity", "组件管理相关");
entityMap.set("x_file_core_entity", "云文件相关");
entityMap.set("x_general_core_entity","常用功能相关");
entityMap.set("x_hotpic_core_entity", "热点信息相关");
entityMap.set("x_jpush_core_entity", "极光推送");
entityMap.set("x_meeting_core_entity", "会议管理相关");
entityMap.set("x_message_core_entity", "消息通信相关");
entityMap.set("x_mind_core_entity", "脑图模块相关");
entityMap.set("x_okr_core_entity", "执行力相关");
entityMap.set("x_organization_core_entity", "组织管理相关");
entityMap.set("x_portal_core_entity", "门户");
entityMap.set("x_processplatform_core_entity", "流程平台");
entityMap.set("x_program_center_core_entity", "中心服务");
entityMap.set("x_query_core_entity", "数据平台全文检索");
entityMap.set("x_teamwork_core_entity", "团队");
$(function() {
$.getJSON('../describe/table/tableList.json?rd=' + Math.random(), function(json) {
$('#apiTable tbody').append("<tr><td colspan='3'><center id='title' style='font-size:32px; font-weight:bold;'>O2OA Table structure</center></td></tr>");
for(var key in json){
var str = '';
str += '<tr>';
if(typeof(entityMap.get(key)) == "undefined"){
str += '<td>' + '</td>';
}else{
str += '<td>' + entityMap.get(key) + '</td>';
}
str += '<td>' + key + '</td>';
str += '<td>';
var url = "./listTableDetail.html?param="+ json[key]
str += '<a href="'+url+'" target="_blank">' + json[key] + '</a><br/>'; ;
str += '</td>';
str += '</tr>';
$('#apiTable tbody').append(str);
}
});
});
}
$(function() {
$.ajax({
type : 'get',
dataType : 'json',
contentType : 'application/json; charset=utf-8',
url : '../jaxrs/jest/list',
xhrFields : {
'withCredentials' : true
},
crossDomain : true,
error : function(e){
$('#contentTable').hide();
}
}).done(function(json) {
if (json.type == 'success') {
if (json.data) {
var str = '<table border="1" id = "apiTable" >';
$.each(json.data, function(index, o) {
str += '<tr>';
str += '<td>' + o.name + '</td>';
str += '<td>' + o.className + '</td>';
str += '<td>';
$.each(o.urlList, function(i, url) {
url = url.replace(/(127.0.0.1)/g, window.location.hostname);
str += '<a href="'+url+'" target="_blank">' + url + '</a><br/>';
});
str += '</td>';
str += '</tr>';
});
str += '<tr><td>中心服务</td><td>com.x.base.core.project.x_program_center</td><td><a href="http://'+window.location.hostname+':20030/x_program_center/jest/index.html" target="_blank">http://'+window.location.hostname+':20030/x_program_center/jest/index.html</a><br></td></tr>';
str += '</table>';
$('#content').html(str);
tableStructure();
}
}
});
});
</script>
</head>
</td>
</tr>
</table>
<body style="font-size: 12px; font-family: Microsoft Yahei; margin: 0px">
<center id="title" style="font-size:32px; font-weight:bold;">O2OA Service API URL</center>
<div id="content" style="margin-top:10px;margin-left: 50px;float: left;">&nbsp;</div>
<div id="contentTable" style="margin-top:20px;margin-left: 50px;float: left;">&nbsp;</div>
</body>
</html>
\ No newline at end of file
</html>
applicationStub_parameter = {};
function applicationStub_list() {
$('#content').html('');
$('#result').html('');
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/applicationstub/list',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
\ No newline at end of file
/*!
* clipboard.js v1.7.1
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){var t,e,n;return function t(e,n,o){function i(a,c){if(!n[a]){if(!e[a]){var l="function"==typeof require&&require;if(!c&&l)return l(a,!0);if(r)return r(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n||t)},u,u.exports,t,e,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(t,e,n){function o(t,e){for(;t&&t.nodeType!==i;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var i=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}e.exports=o},{}],2:[function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function i(t,e,n,o){return function(n){n.delegateTarget=r(n.target,e),n.delegateTarget&&o.call(t,n)}}var r=t("./closest");e.exports=o},{"./closest":1}],3:[function(t,e,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},{}],4:[function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return i(t,e,n);if(c.nodeList(t))return r(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function i(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function r(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return l(document.body,t,e,n)}var c=t("./is"),l=t("delegate");e.exports=o},{"./is":3,delegate:2}],5:[function(t,e,n){function o(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),i=document.createRange();i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i),e=o.toString()}return e}e.exports=o},{}],6:[function(t,e,n){function o(){}o.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){i.off(t,o),e.apply(n,arguments)}var i=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,i=n.length;for(o;o<i;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],i=[];if(o&&e)for(var r=0,a=o.length;r<a;r++)o[r].fn!==e&&o[r].fn._!==e&&i.push(o[r]);return i.length?n[t]=i:delete n[t],this}},e.exports=o},{}],7:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","select"],r);else if(void 0!==o)r(n,e("select"));else{var a={exports:{}};r(a,i.select),i.clipboardAction=a.exports}}(this,function(t,e){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=n(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),c=function(){function t(e){o(this,t),this.resolveOptions(e),this.initSelection()}return a(t,[{key:"resolveOptions",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function t(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function t(){var e=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px";var o=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=o+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function t(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function t(){this.selectedText=(0,i.default)(this.target),this.copyText()}},{key:"copyText",value:function t(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function t(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function t(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function t(){this.removeFake()}},{key:"action",set:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function t(){return this._action}},{key:"target",set:function t(e){if(void 0!==e){if(!e||"object"!==(void 0===e?"undefined":r(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function t(){return this._target}}]),t}();t.exports=c})},{select:5}],8:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if(void 0!==o)r(n,e("./clipboard-action"),e("tiny-emitter"),e("good-listener"));else{var a={exports:{}};r(a,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=a.exports}}(this,function(t,e,n,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function l(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var s=i(e),u=i(n),f=i(o),d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),p=function(t){function e(t,n){r(this,e);var o=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.resolveOptions(n),o.listenClick(t),o}return c(e,t),h(e,[{key:"resolveOptions",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===d(e.container)?e.container:document.body}},{key:"listenClick",value:function t(e){var n=this;this.listener=(0,f.default)(e,"click",function(t){return n.onClick(t)})}},{key:"onClick",value:function t(e){var n=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new s.default({action:this.action(n),target:this.target(n),text:this.text(n),container:this.container,trigger:n,emitter:this})}},{key:"defaultAction",value:function t(e){return l("action",e)}},{key:"defaultTarget",value:function t(e){var n=l("target",e);if(n)return document.querySelector(n)}},{key:"defaultText",value:function t(e){return l("text",e)}},{key:"destroy",value:function t(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],n="string"==typeof e?[e]:e,o=!!document.queryCommandSupported;return n.forEach(function(t){o=o&&!!document.queryCommandSupported(t)}),o}}]),e}(u.default);t.exports=p})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)});
\ No newline at end of file
function failure(data) {
console.log(data);
alert(data.message);
}
function splitValue(str) {
if (str) {
if (str.length > 0) {
return str.split(',');
}
}
return [];
}
function joinValue(o, split) {
var s = ',';
if (split) {
s = '' + split;
}
if (o) {
if (toString.apply(o) === '[object Array]') {
return o.join(s);
}
}
return o;
}
debug_parameter = {};
function debug_init() {
$('#result').html('');
$('#content').html('');
var str = '<table border="1" width="100%">';
str += '<tr><td colspan="2"><a href="#" id="get">get</a>&nbsp<a href="#" id="on">on</a>&nbsp;<a href="#" id="off">off</a></td></tr>';
str += '<tr><td>debug:</td><td id="status">&nbsp;</td></tr>';
str += '</table>';
$('#content').html(str);
$('#get').click(function() {
debug_get();
});
$('#on').click(function() {
debug_on();
});
$('#off').click(function() {
debug_off();
});
}
function debug_get() {
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/debug',
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).done(function(json) {
if (json.type == 'success') {
$('#status').html(json.data.value + '');
}
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
function debug_on() {
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/debug/true',
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).done(function(json) {
if (json.type == 'success') {
$('#status').html(json.data.value + '');
}
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
function debug_off() {
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/debug/false',
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).done(function(json) {
if (json.type == 'success') {
$('#status').html(json.data.value + '');
}
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<script src="./jquery.min.js"></script>
<script src="./clipboard.min.js"></script>
<style type="text/css">
<!--
body {
font-family: Arial, Helvetica, sans-serif;
font-size:12px;
color:#666666;
background:#fff;
text-align:left;
}
a {
color:#1E7ACE;
text-decoration:none;
}
a:hover {
color:#000;
text-decoration:underline;
}
h3 {
font-size:14px;
font-weight:bold;
}
pre,p {
color:#1E7ACE;
margin:4px;
}
input, select,textarea {
padding:1px;
margin:2px;
font-size:11px;
}
fieldset {
padding:10px;
margin-top:10px;
border:1px solid #A4CDF2;
background:#fff;
}
fieldset legend {
color:#1E7ACE;
font-weight:bold;
padding:3px 20px 3px 20px;
border:1px solid #A4CDF2;
background:#fff;
}
input {
border:1px solid #A4CDF2;
}
button {
border:1px solid #A4CDF2;
background-color : #FFFFFF;
height:25px;
margin-top:10px;
font-weight:bold;
color:#1E7ACE;
}
-->
</style>
<script>
var describe;
$.getScript('./describe.js?rd=' + Math.random()).then(function() {
describe = new Describe();
describe.load();
}).catch( function() {
alert('get describe error.');
});
$(document).ready(function(){
var clipboard = new Clipboard("#btn_copy");
$('#butSearch').click(function() {
var strKey = $('#inpSearch').val();
if(strKey == ""){
window.location.reload();
}else{
describe.search(strKey);
}
})
$('#inpSearch').bind('keyup', function(event) {
   if (event.keyCode == "13") {
     $('#butSearch').click();
   }
});
});
</script>
</head>
<body style="font-size: 12px; font-family: Microsoft Yahei; margin: 0px;border-image: linear-gradient(#ffffff, #e7e7e7 15%, #e7e7e7 100%, #ffffff);box-shadow: inset 15px 0 5px -16px #e7e7e7;background-image: -webkit-radial-gradient(right, #f2f2f2, #ffffff 100%);">
<table style="width: 1800px; margin: 0 auto">
<tr>
<td style="width: 350px;" valign="top">
<fieldset>
<legend>search</legend>
<div><input id="inpSearch" style="width:70%;height: 23px; overflow: auto;"/>&nbsp; <button id="butSearch">search</button></div>
</fieldset>
<fieldset>
<legend>API Menu</legend>
<div id="menu" style="height: 850px; overflow: auto;">&nbsp;</div>
</fieldset>
</td>
<td valign="top">
<!--<fieldset>
<legend>Content</legend>
<div id="content"
style="white-space: pre; font-size: 12px; word-break: break-all; word-wrap: break-word">&nbsp;</div>
</fieldset> -->
<div id="content"
style="white-space: pre; font-size: 12px; word-break: break-all; word-wrap: break-word;border-image: linear-gradient(#ffffff, #e7e7e7 15%, #e7e7e7 100%, #ffffff);box-shadow: inset 15px 0 5px -16px #e7e7e7;background-image: -webkit-radial-gradient(right, #f2f2f2, #ffffff 100%);">&nbsp;</div>
<fieldset>
<legend>
Result&nbsp;<a id="btn_copy" href="javascript:" data-clipboard-target="#result">copy</a>&nbsp;
</legend>
<div id="result"
style="white-space: pre; font-size: 12px; word-break: break-all; word-wrap: break-word; width: 1400px">&nbsp;</div>
</fieldset>
<fieldset>
<legend>
Sample&nbsp;<a id="btn_copy" href="javascript:" data-clipboard-target="#Sample">copy</a>&nbsp;
</legend><div style="padding-left:12px">
<div id="Sample"
style="white-space: pre; font-size: 12px; word-break: break-all; word-wrap: break-word; width: 1400px;">&nbsp;</div>
</div>
</fieldset>
</td>
</tr>
</table>
</body>
</html>
\ No newline at end of file
logger_parameter = {};
function logger_init() {
$('#result').html('');
$('#content').html('');
var str = '<table border="1" width="100%">';
str += '<tr><td colspan="2"><a href="#" id="get">get</a>&nbsp<a href="#" id="trace">trace</a>&nbsp;<a href="#" id="debug">debug</a>&nbsp;<a href="#" id="info">info</a>&nbsp;<a href="#" id="warn">warn</a></td></tr>';
str += '<tr><td>debug:</td><td id="level">&nbsp;</td></tr>';
str += '</table>';
$('#content').html(str);
$('#get').click(function() {
logger_get();
});
$('#trace').click(function() {
logger_trace();
});
$('#debug').click(function() {
logger_debug();
});
$('#info').click(function() {
logger_info();
});
$('#warn').click(function() {
logger_warn();
});
}
function logger_get() {
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/logger',
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).done(function(json) {
if (json.type == 'success') {
$('#level').html(json.data.value);
}
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
function logger_trace() {
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/logger/trace',
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
function logger_debug() {
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/logger/debug',
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
function logger_info() {
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/logger/info',
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
function logger_warn() {
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/logger/warn',
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
\ No newline at end of file
state_parameter = {};
function state_summary() {
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/state/summary',
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
function state_running() {
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/state/running',
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
function state_organization() {
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/state/organization',
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
function state_category() {
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/state/category',
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册