WikiStart: geli_admin_auth.html

File geli_admin_auth.html, 23.7 KB (added by chenxiaohu, 11 years ago)
Line 
1<!DOCTYPE html><html>
2
3<head>
4<meta charset="utf-8">
5<title>geli_admin_auth</title>
6<style type="text/css">
7body {
8  font-family: Helvetica, arial, sans-serif;
9  font-size: 14px;
10  line-height: 1.6;
11  padding-top: 10px;
12  padding-bottom: 10px;
13  background-color: white;
14  padding: 30px; }
15
16body > *:first-child {
17  margin-top: 0 !important; }
18body > *:last-child {
19  margin-bottom: 0 !important; }
20
21a {
22  color: #4183C4; }
23a.absent {
24  color: #cc0000; }
25a.anchor {
26  display: block;
27  padding-left: 30px;
28  margin-left: -30px;
29  cursor: pointer;
30  position: absolute;
31  top: 0;
32  left: 0;
33  bottom: 0; }
34
35h1, h2, h3, h4, h5, h6 {
36  margin: 20px 0 10px;
37  padding: 0;
38  font-weight: bold;
39  -webkit-font-smoothing: antialiased;
40  cursor: text;
41  position: relative; }
42
43h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor {
44  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA09pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoMTMuMCAyMDEyMDMwNS5tLjQxNSAyMDEyLzAzLzA1OjIxOjAwOjAwKSAgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUM2NjlDQjI4ODBGMTFFMTg1ODlEODNERDJBRjUwQTQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUM2NjlDQjM4ODBGMTFFMTg1ODlEODNERDJBRjUwQTQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QzY2OUNCMDg4MEYxMUUxODU4OUQ4M0REMkFGNTBBNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QzY2OUNCMTg4MEYxMUUxODU4OUQ4M0REMkFGNTBBNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsQhXeAAAABfSURBVHjaYvz//z8DJYCRUgMYQAbAMBQIAvEqkBQWXI6sHqwHiwG70TTBxGaiWwjCTGgOUgJiF1J8wMRAIUA34B4Q76HUBelAfJYSA0CuMIEaRP8wGIkGMA54bgQIMACAmkXJi0hKJQAAAABJRU5ErkJggg==) no-repeat 10px center;
45  text-decoration: none; }
46
47h1 tt, h1 code {
48  font-size: inherit; }
49
50h2 tt, h2 code {
51  font-size: inherit; }
52
53h3 tt, h3 code {
54  font-size: inherit; }
55
56h4 tt, h4 code {
57  font-size: inherit; }
58
59h5 tt, h5 code {
60  font-size: inherit; }
61
62h6 tt, h6 code {
63  font-size: inherit; }
64
65h1 {
66  font-size: 28px;
67  color: black; }
68
69h2 {
70  font-size: 24px;
71  border-bottom: 1px solid #cccccc;
72  color: black; }
73
74h3 {
75  font-size: 18px; }
76
77h4 {
78  font-size: 16px; }
79
80h5 {
81  font-size: 14px; }
82
83h6 {
84  color: #777777;
85  font-size: 14px; }
86
87p, blockquote, ul, ol, dl, li, table, pre {
88  margin: 15px 0; }
89
90hr {
91  background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAECAYAAACtBE5DAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OENDRjNBN0E2NTZBMTFFMEI3QjRBODM4NzJDMjlGNDgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OENDRjNBN0I2NTZBMTFFMEI3QjRBODM4NzJDMjlGNDgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4Q0NGM0E3ODY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4Q0NGM0E3OTY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqqezsUAAAAfSURBVHjaYmRABcYwBiM2QSA4y4hNEKYDQxAEAAIMAHNGAzhkPOlYAAAAAElFTkSuQmCC) repeat-x 0 0;
92  border: 0 none;
93  color: #cccccc;
94  height: 4px;
95  padding: 0;
96}
97
98body > h2:first-child {
99  margin-top: 0;
100  padding-top: 0; }
101body > h1:first-child {
102  margin-top: 0;
103  padding-top: 0; }
104  body > h1:first-child + h2 {
105    margin-top: 0;
106    padding-top: 0; }
107body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child {
108  margin-top: 0;
109  padding-top: 0; }
110
111a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 {
112  margin-top: 0;
113  padding-top: 0; }
114
115h1 p, h2 p, h3 p, h4 p, h5 p, h6 p {
116  margin-top: 0; }
117
118li p.first {
119  display: inline-block; }
120li {
121  margin: 0; }
122ul, ol {
123  padding-left: 30px; }
124
125ul :first-child, ol :first-child {
126  margin-top: 0; }
127
128dl {
129  padding: 0; }
130  dl dt {
131    font-size: 14px;
132    font-weight: bold;
133    font-style: italic;
134    padding: 0;
135    margin: 15px 0 5px; }
136    dl dt:first-child {
137      padding: 0; }
138    dl dt > :first-child {
139      margin-top: 0; }
140    dl dt > :last-child {
141      margin-bottom: 0; }
142  dl dd {
143    margin: 0 0 15px;
144    padding: 0 15px; }
145    dl dd > :first-child {
146      margin-top: 0; }
147    dl dd > :last-child {
148      margin-bottom: 0; }
149
150blockquote {
151  border-left: 4px solid #dddddd;
152  padding: 0 15px;
153  color: #777777; }
154  blockquote > :first-child {
155    margin-top: 0; }
156  blockquote > :last-child {
157    margin-bottom: 0; }
158
159table {
160  padding: 0;border-collapse: collapse; }
161  table tr {
162    border-top: 1px solid #cccccc;
163    background-color: white;
164    margin: 0;
165    padding: 0; }
166    table tr:nth-child(2n) {
167      background-color: #f8f8f8; }
168    table tr th {
169      font-weight: bold;
170      border: 1px solid #cccccc;
171      margin: 0;
172      padding: 6px 13px; }
173    table tr td {
174      border: 1px solid #cccccc;
175      margin: 0;
176      padding: 6px 13px; }
177    table tr th :first-child, table tr td :first-child {
178      margin-top: 0; }
179    table tr th :last-child, table tr td :last-child {
180      margin-bottom: 0; }
181
182img {
183  max-width: 100%; }
184
185span.frame {
186  display: block;
187  overflow: hidden; }
188  span.frame > span {
189    border: 1px solid #dddddd;
190    display: block;
191    float: left;
192    overflow: hidden;
193    margin: 13px 0 0;
194    padding: 7px;
195    width: auto; }
196  span.frame span img {
197    display: block;
198    float: left; }
199  span.frame span span {
200    clear: both;
201    color: #333333;
202    display: block;
203    padding: 5px 0 0; }
204span.align-center {
205  display: block;
206  overflow: hidden;
207  clear: both; }
208  span.align-center > span {
209    display: block;
210    overflow: hidden;
211    margin: 13px auto 0;
212    text-align: center; }
213  span.align-center span img {
214    margin: 0 auto;
215    text-align: center; }
216span.align-right {
217  display: block;
218  overflow: hidden;
219  clear: both; }
220  span.align-right > span {
221    display: block;
222    overflow: hidden;
223    margin: 13px 0 0;
224    text-align: right; }
225  span.align-right span img {
226    margin: 0;
227    text-align: right; }
228span.float-left {
229  display: block;
230  margin-right: 13px;
231  overflow: hidden;
232  float: left; }
233  span.float-left span {
234    margin: 13px 0 0; }
235span.float-right {
236  display: block;
237  margin-left: 13px;
238  overflow: hidden;
239  float: right; }
240  span.float-right > span {
241    display: block;
242    overflow: hidden;
243    margin: 13px auto 0;
244    text-align: right; }
245
246code, tt {
247  margin: 0 2px;
248  padding: 0 5px;
249  white-space: nowrap;
250  border: 1px solid #eaeaea;
251  background-color: #f8f8f8;
252  border-radius: 3px; }
253
254pre code {
255  margin: 0;
256  padding: 0;
257  white-space: pre;
258  border: none;
259  background: transparent; }
260
261.highlight pre {
262  background-color: #f8f8f8;
263  border: 1px solid #cccccc;
264  font-size: 13px;
265  line-height: 19px;
266  overflow: auto;
267  padding: 6px 10px;
268  border-radius: 3px; }
269
270pre {
271  background-color: #f8f8f8;
272  border: 1px solid #cccccc;
273  font-size: 13px;
274  line-height: 19px;
275  overflow: auto;
276  padding: 6px 10px;
277  border-radius: 3px; }
278  pre code, pre tt {
279    background-color: transparent;
280    border: none; }
281
282sup {
283    font-size: 0.83em;
284    vertical-align: super;
285    line-height: 0;
286}
287* {
288        -webkit-print-color-adjust: exact;
289}
290@media screen and (min-width: 914px) {
291    body {
292        width: 854px;
293        margin:0 auto;
294    }
295}
296@media print {
297        table, pre {
298                page-break-inside: avoid;
299        }
300        pre {
301                word-wrap: break-word;
302        }
303}
304</style>
305<style type="text/css">
306/**
307 * prism.js default theme for JavaScript, CSS and HTML
308 * Based on dabblet (http://dabblet.com)
309 * @author Lea Verou
310 */
311
312code[class*="language-"],
313pre[class*="language-"] {
314        color: black;
315        text-shadow: 0 1px white;
316        font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
317        direction: ltr;
318        text-align: left;
319        white-space: pre;
320        word-spacing: normal;
321        word-break: normal;
322        word-wrap: normal;
323        line-height: 1.5;
324
325        -moz-tab-size: 4;
326        -o-tab-size: 4;
327        tab-size: 4;
328
329        -webkit-hyphens: none;
330        -moz-hyphens: none;
331        -ms-hyphens: none;
332        hyphens: none;
333}
334
335pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
336code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
337        text-shadow: none;
338        background: #b3d4fc;
339}
340
341pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
342code[class*="language-"]::selection, code[class*="language-"] ::selection {
343        text-shadow: none;
344        background: #b3d4fc;
345}
346
347@media print {
348        code[class*="language-"],
349        pre[class*="language-"] {
350                text-shadow: none;
351        }
352}
353
354/* Code blocks */
355pre[class*="language-"] {
356        padding: 1em;
357        margin: .5em 0;
358        overflow: auto;
359}
360
361:not(pre) > code[class*="language-"],
362pre[class*="language-"] {
363        background: #f5f2f0;
364}
365
366/* Inline code */
367:not(pre) > code[class*="language-"] {
368        padding: .1em;
369        border-radius: .3em;
370}
371
372.token.comment,
373.token.prolog,
374.token.doctype,
375.token.cdata {
376        color: slategray;
377}
378
379.token.punctuation {
380        color: #999;
381}
382
383.namespace {
384        opacity: .7;
385}
386
387.token.property,
388.token.tag,
389.token.boolean,
390.token.number,
391.token.constant,
392.token.symbol,
393.token.deleted {
394        color: #905;
395}
396
397.token.selector,
398.token.attr-name,
399.token.string,
400.token.char,
401.token.builtin,
402.token.inserted {
403        color: #690;
404}
405
406.token.operator,
407.token.entity,
408.token.url,
409.language-css .token.string,
410.style .token.string {
411        color: #a67f59;
412        background: hsla(0, 0%, 100%, .5);
413}
414
415.token.atrule,
416.token.attr-value,
417.token.keyword {
418        color: #07a;
419}
420
421.token.function {
422        color: #DD4A68;
423}
424
425.token.regex,
426.token.important,
427.token.variable {
428        color: #e90;
429}
430
431.token.important,
432.token.bold {
433        font-weight: bold;
434}
435.token.italic {
436        font-style: italic;
437}
438
439.token.entity {
440        cursor: help;
441}
442</style>
443</head>
444<body>
445<h1 id="toc_0">给力框架后台权限匀发诎明</h1>
446
447<p>陈小虎倪平掋眑络2015幎10月</p>
448
449<h2 id="toc_1">1 讟计思路</h2>
450
451<h3 id="toc_2">1.1 现状</h3>
452
453<p>䜜䞺䞀䞪快速匀发的框架和工具给力对于实䜓对象自劚生成了增删改查的基本UI功胜垌望胜尜可胜的减少匀发的重倍工䜜取埗了䞍错的效果。</p>
454
455<p>最初讟计的思路埈简单对于实䜓对象提䟛基本的功胜圓这些功胜䞍借甚时匀发可以通过代码生成工具生成代码经过改进后芆盖基本功胜。对于权限郚分因䞺䞚务的千差䞇别䞍奜提䟛简单的方法所以需芁每䞪应甚自己倄理代码生成工具圚应甚里面生成了AuthFilter这䞪过滀噚并实现了对于后台权限日志等基本功胜的权限限制代码垌望匀发人员胜借自己添加代码倄理其他郚分的权限问题。</p>
456
457<p>遗憟的是碰到了䞀䞪问题銖先由于讟计的疏応AuthFilter的代码讟计成了黑名单暡匏就是诎对于䞀䞪功胜陀非加了限制吊则谁郜胜访问其次对于框架的培训和培训结果的确讀䞍借圻底富臎有些匀发䞍枅楚这郚分的讟计。以至于新加了实䜓可胜忘记加权限限制。</p>
458
459<p>基于以䞊原因需芁对这郚分重新讟计并加区培训来解决这䞪问题因歀也就有了本文。</p>
460
461<h3 id="toc_3">1.2 改进</h3>
462
463<p>銖先对于AuthFilter的讟计改䞺癜名单方匏圓然这里有些折䞭就是猺省情况所有的修改权限必须是系统的超级管理员才胜䜿甚所有的查看权限必须是本应甚的后台登陆甚户才胜䜿甚。盞信这种讟定对倧郚分情况郜是合理的。</p>
464
465<p>其次对于需芁特殊倄理的情况可以通过AuthFilter里面的hasRight方法来进行倄理可以指定0 - 䞍倄理(采甚猺省倄理1 - 没有权限2 - 有权限 这䞉种情况来简化事情。甚癜名单䞺䞻的方匏来解决问题避免无意的遗挏权限。</p>
466
467<p>最后劂果这套方案完党䞍胜满足还可以自己Override过滀噚方法完党定制圓然这种情况应该比蟃少见。</p>
468
469<h3 id="toc_4">1.3 代码诎明</h3>
470
471<p>现圚的情况是自劚生成的代码AuthFilter里面䌚挏了增加权限限制。代码暡板劂䞋:</p>
472
473<pre><code class="language-java">
474/// 泚意这种方法有风险需芁改进䞺新暡匏
475/// 泚意这种方法有风险需芁改进䞺新暡匏
476/// 泚意这种方法有风险需芁改进䞺新暡匏
477@Override
478public void doFilter(ServletRequest request, ServletResponse response,
479        FilterChain chain) throws IOException, ServletException {
480
481    HttpServletRequest req = (HttpServletRequest)request;
482    HttpServletResponse resp = (HttpServletResponse)response;
483    String uri = req.getRequestURI();
484    Env env = EnvUtils.getEnv();
485
486    if (LOG.isDebugEnabled()) {
487        LOG.debug(&quot;AuthFilter process: &quot; + uri);
488    }
489
490    HttpMethod method = env.getHttpMethod();
491    GeliAuthFacade authFacade = env.getBean(GeliAuthFacade.class);
492
493    String adminPrefix = env.getServletContext().getContextPath() + &quot;/admin&quot;;
494    if (uri.startsWith(adminPrefix + &quot;/geli&quot;) &amp;&amp; !uri.endsWith(&quot;geliuser/select.do&quot;)) {
495        if (! authFacade.isAdmin()) {
496            if (method == HttpMethod.POST) {
497                sendAuthFail(resp, true);
498            } else {
499                sendAuthFail(resp, false);
500            }
501            return;
502        }
503    }
504
505    // Please process application auth here:
506    // ...
507    // ...
508
509    chain.doFilter(request, response);
510
511}
512</code></pre>
513
514<p>由于只对 /admin/geli*** 的url做了限制甚户自己增加的实䜓需芁自己家限制䜆是瀺䟋代码页比蟃麻烊所以埈隟让倧家搞奜。</p>
515
516<p>改进后的暡板目标曎明确就是䞓泚于限制后台自劚提䟛的功胜。暡板劂䞋</p>
517
518<pre><code class="language-java">
519static final String CREATE_DO = &quot;create.do&quot;;
520static final String UPDATE_DO = &quot;update.do&quot;;
521static final String DELETE_DO = &quot;delete.do&quot;;
522
523@Override
524public int hasRight(HttpServletRequest req) {
525    Env env = EnvUtils.getEnv();
526    GeliAuthFacade authFacade = env.getBean(GeliAuthFacade.class);
527
528    // examples...
529    if (matchActions(&quot;sales&quot;, req, CREATE_DO, UPDATE_DO, DELETE_DO)) {
530        return authFacade.hasRight(GeliFunction.read(&quot;sales_maint&quot;)) ? HAS_RIGHT : HAS_NOT_RIGHT;
531    }
532   
533    return DEFAULT_RIGHT;
534}
535
536// check request uri match ${contextPath}/admin/${entityName}/${one of actions}
537boolean matchActions(String entityName, HttpServletRequest req, String ... actions) {
538    String uri = req.getRequestURI();
539    Env env = EnvUtils.getEnv();
540    String uriPrefix = env.getServletContext().getContextPath() + &quot;/admin/&quot; + entityName.toLowerCase() + &#39;/&#39;;
541    for (String action : actions) {
542        if (uri.startsWith(uriPrefix + action)) {
543            return true;
544        }
545    }
546    return false;
547}
548</code></pre>
549
550<p>倧郚分情况只芁按照example的暡匏就可限制了其他情况可以自己特殊倄理。</p>
551
552<p>example提䟛的䟋子衚瀺对于实䜓Sales盞关的 create.do | update.do | delete.do 劂果拥有sales_maint销售绎技权限可以䜿甚吊则按照系统的猺省暡匏只有系统超级管理员才胜䜿甚。</p>
553
554<h2 id="toc_5">2 䞉种情况</h2>
555
556<h3 id="toc_6">2.1 最简单情况</h3>
557
558<p>应甚非垞简单而䞔就少数几䞪甚户䜿甚。盎接将甚户讟眮䞺超级管理员䞍甚考虑权限问题系统猺省方案䌚盎接满足需求。</p>
559
560<p>简单䜆是只适甚于特定的情况。</p>
561
562<blockquote>
563<p>感觉䞍错啥郜䞍甚做啊䜆是䞍䌚每次这么奜运气:)</p>
564</blockquote>
565
566<h3 id="toc_7">2.2 最可胜情况</h3>
567
568<p>对于倧郚分情况应该䌚有超级管理员以倖的甚户角色䜆是还是有埈倚的权限只给超级管理员甚对于普通甚户芁䜿甚的功胜圚 hasRight 方法里面进行特别允讞就可以了。1.3节的example埈奜的诎明了这种情况。</p>
569
570<h3 id="toc_8">2.3 倍杂情况</h3>
571
572<p>对于倍杂的倧型应甚圓后台权限系统埈倍杂时最奜自己进行定制匀发这里只提䟛䞀种思路䞀种就是将哪些url的哪些http方法GET、POST等对应哪些功胜做䞀䞪暡块进行配眮。</p>
573
574<p>曎倍杂的就芁完党定制了。因䞺埈权限和数据还有关系就芁䜿甚资源的抂念了。</p>
575
576<h2 id="toc_9">3 安党升级</h2>
577
578<p>所有䜿甚 geli-2.x 的应甚郜需芁升级升级方匏劂䞋</p>
579
580<ol>
581<li>升级到geli-2.0.8版本请泚意䟝赖包的版本</li>
582<li>修改本应甚的AuthFilter代码新的代码暡板䞋蜜<a href="http://trac.pc.com.cn/geli/attachment/wiki/QuickStart/AuthFilter.java">AuthFilter.java</a></li>
583<li>修改web.xmläž­AuthFilter的<code>url-pattern</code>从 <code>*.do</code> åˆ° <code>/admin/*</code> 以提高前台的效率</li>
584</ol>
585
586<script type="text/javascript">
587var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=_self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content),e.alias):"Array"===t.util.type(e)?e.map(t.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var a={};for(var r in e)e.hasOwnProperty(r)&&(a[r]=t.util.clone(e[r]));return a;case"Array":return e.map&&e.map(function(e){return t.util.clone(e)})}return e}},languages:{extend:function(e,n){var a=t.util.clone(t.languages[e]);for(var r in n)a[r]=n[r];return a},insertBefore:function(e,n,a,r){r=r||t.languages;var l=r[e];if(2==arguments.length){a=arguments[1];for(var i in a)a.hasOwnProperty(i)&&(l[i]=a[i]);return l}var o={};for(var s in l)if(l.hasOwnProperty(s)){if(s==n)for(var i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);o[s]=l[s]}return t.languages.DFS(t.languages,function(t,n){n===r[e]&&t!=e&&(this[t]=o)}),r[e]=o},DFS:function(e,n,a){for(var r in e)e.hasOwnProperty(r)&&(n.call(e,r,e[r],a||r),"Object"===t.util.type(e[r])?t.languages.DFS(e[r],n):"Array"===t.util.type(e[r])&&t.languages.DFS(e[r],n,r))}},plugins:{},highlightAll:function(e,n){for(var a,r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),l=0;a=r[l++];)t.highlightElement(a,e===!0,n)},highlightElement:function(n,a,r){for(var l,i,o=n;o&&!e.test(o.className);)o=o.parentNode;o&&(l=(o.className.match(e)||[,""])[1],i=t.languages[l]),n.className=n.className.replace(e,"").replace(/\s+/g," ")+" language-"+l,o=n.parentNode,/pre/i.test(o.nodeName)&&(o.className=o.className.replace(e,"").replace(/\s+/g," ")+" language-"+l);var s=n.textContent,u={element:n,language:l,grammar:i,code:s};if(!s||!i)return t.hooks.run("complete",u),void 0;if(t.hooks.run("before-highlight",u),a&&_self.Worker){var g=new Worker(t.filename);g.onmessage=function(e){u.highlightedCode=e.data,t.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,r&&r.call(u.element),t.hooks.run("after-highlight",u),t.hooks.run("complete",u)},g.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else u.highlightedCode=t.highlight(u.code,u.grammar,u.language),t.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,r&&r.call(n),t.hooks.run("after-highlight",u),t.hooks.run("complete",u)},highlight:function(e,a,r){var l=t.tokenize(e,a);return n.stringify(t.util.encode(l),r)},tokenize:function(e,n){var a=t.Token,r=[e],l=n.rest;if(l){for(var i in l)n[i]=l[i];delete n.rest}e:for(var i in n)if(n.hasOwnProperty(i)&&n[i]){var o=n[i];o="Array"===t.util.type(o)?o:[o];for(var s=0;s<o.length;++s){var u=o[s],g=u.inside,c=!!u.lookbehind,f=0,h=u.alias;u=u.pattern||u;for(var p=0;p<r.length;p++){var d=r[p];if(r.length>e.length)break e;if(!(d instanceof a)){u.lastIndex=0;var m=u.exec(d);if(m){c&&(f=m[1].length);var y=m.index-1+f,m=m[0].slice(f),v=m.length,k=y+v,b=d.slice(0,y+1),w=d.slice(k+1),P=[p,1];b&&P.push(b);var A=new a(i,g?t.tokenize(m,g):m,h);P.push(A),w&&P.push(w),Array.prototype.splice.apply(r,P)}}}}}return r},hooks:{all:{},add:function(e,n){var a=t.hooks.all;a[e]=a[e]||[],a[e].push(n)},run:function(e,n){var a=t.hooks.all[e];if(a&&a.length)for(var r,l=0;r=a[l++];)r(n)}}},n=t.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(n.stringify=function(e,a,r){if("string"==typeof e)return e;if("Array"===t.util.type(e))return e.map(function(t){return n.stringify(t,a,e)}).join("");var l={type:e.type,content:n.stringify(e.content,a,r),tag:"span",classes:["token",e.type],attributes:{},language:a,parent:r};if("comment"==l.type&&(l.attributes.spellcheck="true"),e.alias){var i="Array"===t.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}t.hooks.run("wrap",l);var o="";for(var s in l.attributes)o+=(o?" ":"")+s+'="'+(l.attributes[s]||"")+'"';return"<"+l.tag+' class="'+l.classes.join(" ")+'" '+o+">"+l.content+"</"+l.tag+">"},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var n=JSON.parse(e.data),a=n.language,r=n.code,l=n.immediateClose;_self.postMessage(t.highlight(r,t.languages[a],a)),l&&_self.close()},!1),_self.Prism):_self.Prism;var a=document.getElementsByTagName("script");return a=a[a.length-1],a&&(t.filename=a.src,document.addEventListener&&!a.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
588</script>
589<script type="text/javascript">
590Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};
591</script>
592<script type="text/javascript">
593Prism.languages.java=Prism.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0}});
594</script>
595</body>
596
597</html>