Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xzxt-shiro
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常超
xzxt-shiro
Commits
8c276cc0
Commit
8c276cc0
authored
Jul 26, 2018
by
liuyongshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整部分页面选择权限和单位代码按钮样式;去掉菜单管理;修复新增用户无法登陆的问题;修复3.0切换用户跳转失败问题
parent
f6d5bccf
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
60 additions
and
14 deletions
+60
-14
src/main/java/com/xzxtshiro/mapper/SysUserMapper.xml
+1
-1
src/main/java/com/xzxtshiro/pojo/SysUser.java
+1
-1
src/main/java/com/xzxtshiro/service/imp/SysUserServiceImpl.java
+1
-0
src/main/java/com/xzxtshiro/shiro/realm/ShiroRealm.java
+49
-0
src/main/webapp/WEB-INF/jsp/admin/permission/add.jsp
+1
-1
src/main/webapp/WEB-INF/jsp/admin/permission/update.jsp
+1
-1
src/main/webapp/WEB-INF/jsp/admin/user/add.jsp
+2
-2
src/main/webapp/WEB-INF/jsp/admin/user/update.jsp
+2
-2
src/main/webapp/WEB-INF/jsp/welcome.jsp
+0
-4
src/main/webapp/resources/ztree/metroStyle/metroStyle.css
+2
-2
No files found.
src/main/java/com/xzxtshiro/mapper/SysUserMapper.xml
View file @
8c276cc0
...
...
@@ -477,7 +477,7 @@
ID, NAME, MENUNAME, PID, PERMISSION, URL, DESCRIPTION, TYPE
FROM
sys_permission_new
where flag=1/*生成菜单*/
where
scbz = 0 AND
flag=1/*生成菜单*/
</select>
<!--根据userid查询菜单-->
<select
id=
"selectMencusByUserId"
resultType=
"com.xzxtshiro.pojo.SysPermissionNew"
>
...
...
src/main/java/com/xzxtshiro/pojo/SysUser.java
View file @
8c276cc0
...
...
@@ -60,7 +60,7 @@ public class SysUser extends BaseModel implements Serializable {
protected
String
policemanid
;
protected
BigDecimal
defaultDesktop
;
protected
Integer
defaultDesktop
;
protected
String
theme
;
...
...
src/main/java/com/xzxtshiro/service/imp/SysUserServiceImpl.java
View file @
8c276cc0
...
...
@@ -105,6 +105,7 @@ public class SysUserServiceImpl implements SysUserService {
user
.
setId
(
userId
);
user
.
setLrsj
(
new
Date
());
user
.
setScbz
(
0
);
user
.
setDefaultDesktop
(
0
);
user
.
setLrr
(
"admin"
);
int
i
=
userDao
.
insert
(
user
);
String
roleIds
=
user
.
getRoleId
();
...
...
src/main/java/com/xzxtshiro/shiro/realm/ShiroRealm.java
View file @
8c276cc0
...
...
@@ -18,9 +18,11 @@ import org.apache.shiro.authc.UnknownAccountException;
import
org.apache.shiro.authc.UsernamePasswordToken
;
import
org.apache.shiro.authz.AuthorizationInfo
;
import
org.apache.shiro.authz.SimpleAuthorizationInfo
;
import
org.apache.shiro.cache.Cache
;
import
org.apache.shiro.crypto.hash.SimpleHash
;
import
org.apache.shiro.realm.AuthorizingRealm
;
import
org.apache.shiro.subject.PrincipalCollection
;
import
org.apache.shiro.subject.SimplePrincipalCollection
;
import
org.apache.shiro.util.ByteSource
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -96,4 +98,50 @@ public class ShiroRealm extends AuthorizingRealm {
logger
.
info
(
"permission => "
+
resStrList
);
return
info
;
}
@Override
protected
void
clearCachedAuthenticationInfo
(
PrincipalCollection
principals
)
{
Cache
c
=
getAuthenticationCache
();
logger
.
info
(
"清除【认证】缓存之前"
);
for
(
Object
o
:
c
.
keys
())
{
logger
.
info
(
o
+
" , "
+
c
.
get
(
o
));
}
super
.
clearCachedAuthenticationInfo
(
principals
);
logger
.
info
(
"调用父类清除【认证】缓存之后"
);
for
(
Object
o
:
c
.
keys
())
{
logger
.
info
(
o
+
" , "
+
c
.
get
(
o
));
}
// 添加下面的代码清空【认证】的缓存
SysUser
user
=
(
SysUser
)
principals
.
getPrimaryPrincipal
();
SimplePrincipalCollection
spc
=
new
SimplePrincipalCollection
(
user
.
getUsername
(),
getName
());
super
.
clearCachedAuthenticationInfo
(
spc
);
logger
.
info
(
"添加了代码清除【认证】缓存之后"
);
int
cacheSize
=
c
.
keys
().
size
();
logger
.
info
(
"【认证】缓存的大小:"
+
c
.
keys
().
size
());
if
(
cacheSize
==
0
)
{
logger
.
info
(
"说明【认证】缓存被清空了。"
);
}
}
@Override
protected
void
clearCachedAuthorizationInfo
(
PrincipalCollection
principals
)
{
logger
.
info
(
"清除【授权】缓存之前"
);
Cache
c
=
getAuthorizationCache
();
for
(
Object
o
:
c
.
keys
())
{
logger
.
info
(
o
+
" , "
+
c
.
get
(
o
));
}
super
.
clearCachedAuthorizationInfo
(
principals
);
logger
.
info
(
"清除【授权】缓存之后"
);
int
cacheSize
=
c
.
keys
().
size
();
logger
.
info
(
"【授权】缓存的大小:"
+
cacheSize
);
for
(
Object
o
:
c
.
keys
())
{
logger
.
info
(
o
+
" , "
+
c
.
get
(
o
));
}
if
(
cacheSize
==
0
)
{
logger
.
info
(
"说明【授权】缓存被清空了。"
);
}
}
}
\ No newline at end of file
src/main/webapp/WEB-INF/jsp/admin/permission/add.jsp
View file @
8c276cc0
...
...
@@ -86,7 +86,7 @@
<input
type=
"text"
name=
"pidName"
id=
"pidName"
lay-verify=
"required"
class=
"layui-input"
>
<input
type=
"text"
id=
"pid"
Name=
"pid"
style=
"display: none;"
>
<span
class=
"layui-btn"
id=
"checkPer"
onclick=
"checkTree('mytree');"
style=
"left:
363
px"
>
选择父级
</span>
<span
class=
"layui-btn"
id=
"checkPer"
onclick=
"checkTree('mytree');"
style=
"left:
448
px"
>
选择父级
</span>
<div
id=
"mytree"
style=
"display: none"
>
<ul
id=
"tree"
class=
"ztree"
></ul>
</div>
...
...
src/main/webapp/WEB-INF/jsp/admin/permission/update.jsp
View file @
8c276cc0
...
...
@@ -88,7 +88,7 @@
<input
type=
"text"
name=
"pidName"
id=
"pidName"
lay-verify=
"required"
class=
"layui-input"
>
<input
type=
"text"
id=
"pid"
Name=
"pid"
style=
"display: none;"
>
<span
class=
"layui-btn"
id=
"checkPer"
onclick=
"checkTree('mytree');"
style=
"left:
363
px"
>
选择父级
</span>
<span
class=
"layui-btn"
id=
"checkPer"
onclick=
"checkTree('mytree');"
style=
"left:
448
px"
>
选择父级
</span>
<div
id=
"mytree"
style=
"display: none"
>
<ul
id=
"tree"
class=
"ztree"
></ul>
</div>
...
...
src/main/webapp/WEB-INF/jsp/admin/user/add.jsp
View file @
8c276cc0
...
...
@@ -108,7 +108,7 @@
<input
type=
"text"
name=
"unitname"
id=
"unitname"
lay-verify=
"required"
class=
"layui-input"
>
<input
type=
"text"
id=
"unitcode"
Name=
"unitcode"
style=
"display: none;"
>
<span
class=
"layui-btn"
id=
"checkPer"
onclick=
"checkTree('myUnitTree');"
>
选择单位
</span>
<span
class=
"layui-btn"
id=
"checkPer"
onclick=
"checkTree('myUnitTree');"
style=
"left: 448px;"
>
选择单位
</span>
<div
id=
"myUnitTree"
style=
"display: none"
>
<ul
id=
"unit"
class=
"ztree"
></ul>
</div>
...
...
@@ -121,7 +121,7 @@
<input
type=
"text"
name=
"roleName"
id=
"roleName"
lay-verify=
"required"
class=
"layui-input"
>
<input
type=
"text"
id=
"roleId"
Name=
"roleId"
style=
"display: none;"
>
<span
class=
"layui-btn"
id=
"checkRolePid"
onclick=
"checkTree('myRoleTree');"
>
选择角色
</span>
<span
class=
"layui-btn"
id=
"checkRolePid"
onclick=
"checkTree('myRoleTree');"
style=
"left: 448px;"
>
选择角色
</span>
<div
id=
"myRoleTree"
style=
"display: none"
>
<ul
id=
"roleTree"
class=
"ztree"
></ul>
</div>
...
...
src/main/webapp/WEB-INF/jsp/admin/user/update.jsp
View file @
8c276cc0
...
...
@@ -102,7 +102,7 @@
<input
type=
"text"
name=
"unitname"
id=
"unitname"
lay-verify=
"required"
class=
"layui-input"
>
<input
type=
"text"
id=
"unitcode"
Name=
"unitcode"
style=
"display: none;"
>
<span
class=
"layui-btn"
id=
"checkPer"
onclick=
"checkTree('myUnitTree');"
>
选择单位
</span>
<span
class=
"layui-btn"
id=
"checkPer"
onclick=
"checkTree('myUnitTree');"
style=
"left: 448px;"
>
选择单位
</span>
<div
id=
"myUnitTree"
style=
"display: none"
>
<ul
id=
"unit"
class=
"ztree"
></ul>
</div>
...
...
@@ -115,7 +115,7 @@
<input
type=
"text"
name=
"roleName"
id=
"roleName"
lay-verify=
"required"
class=
"layui-input"
>
<input
type=
"text"
id=
"roleId"
Name=
"roleId"
style=
"display: none;"
>
<span
class=
"layui-btn"
id=
"checkRolePid"
onclick=
"checkTree('myRoleTree');"
>
选择角色
</span>
<span
class=
"layui-btn"
id=
"checkRolePid"
onclick=
"checkTree('myRoleTree');"
style=
"left: 448px;"
>
选择角色
</span>
<div
id=
"myRoleTree"
style=
"display: none"
>
<ul
id=
"roleTree"
class=
"ztree"
></ul>
</div>
...
...
src/main/webapp/WEB-INF/jsp/welcome.jsp
View file @
8c276cc0
...
...
@@ -75,10 +75,6 @@
style=
"width:21pt; text-indent:0pt; display:inline-block"
></span><span
style=
"font-family:等线; font-size:14pt"
>
权限管理
</span></p>
<p
style=
"margin:0pt; orphans:0; text-align:justify; text-indent:20pt; widows:0"
><span
style=
"width:1pt; text-indent:0pt; display:inline-block"
></span><span
style=
"width:21pt; text-indent:0pt; display:inline-block"
></span><span
style=
"font-family:等线; font-size:14pt"
>
菜单管理
</span></p>
<p
style=
"margin:0pt; orphans:0; text-align:justify; text-indent:20pt; widows:0"
><span
style=
"font-family:等线; font-size:14pt"
>
 
</span></p>
<p
style=
"margin:0pt; orphans:0; text-align:justify; text-indent:20pt; widows:0"
><span
style=
"font-family:等线; font-size:14pt"
>
开发环境
</span><span
style=
"font-family:等线; font-size:14pt"
>
:
</span>
...
...
src/main/webapp/resources/ztree/metroStyle/metroStyle.css
View file @
8c276cc0
...
...
@@ -101,6 +101,6 @@ ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height
}
.layui-form-item
>
.layui-input-block
>
span
{
position
:
relative
;
left
:
553
px
;
top
:
-3
7
px
;
left
:
634
px
;
top
:
-3
8
px
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment