Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
1616884c
Commit
1616884c
authored
Oct 08, 2018
by
fengshuonan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理结构
parent
71842f52
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
105 deletions
+18
-105
guns-admin/src/main/java/com/stylefeng/guns/core/aop/PermissionAop.java
+1
-1
guns-admin/src/main/java/com/stylefeng/guns/core/beetl/BeetlConfiguration.java
+10
-22
guns-admin/src/main/java/com/stylefeng/guns/core/beetl/ShiroExt.java
+2
-9
guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/dictmap/base/SystemDict.java
+0
-2
guns-admin/src/main/java/com/stylefeng/guns/core/node/ZTreeNode.java
+5
-6
guns-admin/src/main/java/com/stylefeng/guns/core/page/PageBT.java
+0
-65
No files found.
guns-admin/src/main/java/com/stylefeng/guns/core/aop/PermissionAop.java
View file @
1616884c
...
...
@@ -47,7 +47,7 @@ public class PermissionAop {
Method
method
=
ms
.
getMethod
();
Permission
permission
=
method
.
getAnnotation
(
Permission
.
class
);
Object
[]
permissions
=
permission
.
value
();
if
(
permissions
==
null
||
permissions
.
length
==
0
)
{
if
(
permissions
.
length
==
0
)
{
//检查全体角色
boolean
result
=
PermissionCheckManager
.
checkAll
();
if
(
result
)
{
...
...
guns-admin/src/main/java/com/stylefeng/guns/core/beetl/BeetlConfiguration.java
View file @
1616884c
...
...
@@ -5,14 +5,12 @@ import com.stylefeng.guns.core.tag.DictSelectorTag;
import
com.stylefeng.guns.core.util.KaptchaUtil
;
import
org.beetl.core.Context
;
import
org.beetl.core.Function
;
import
org.beetl.core.Tag
;
import
org.beetl.core.TagFactory
;
import
org.beetl.ext.spring.BeetlGroupUtilConfiguration
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.core.env.Environment
;
import
java.io.UnsupportedEncodingException
;
import
java.nio.charset.StandardCharsets
;
/**
* beetl拓展配置,绑定一些工具类,方便在模板中直接调用
...
...
@@ -23,45 +21,35 @@ import java.io.UnsupportedEncodingException;
public
class
BeetlConfiguration
extends
BeetlGroupUtilConfiguration
{
@Autowired
Environment
env
;
private
Environment
env
;
@Autowired
ApplicationContext
applicationContext
;
@Autowired
DictSelectorTag
dictSelectorTag
;
private
DictSelectorTag
dictSelectorTag
;
@Override
public
void
initOther
()
{
groupTemplate
.
registerFunctionPackage
(
"shiro"
,
new
ShiroExt
());
groupTemplate
.
registerFunctionPackage
(
"tool"
,
new
ToolUtil
());
groupTemplate
.
registerFunctionPackage
(
"kaptcha"
,
new
KaptchaUtil
());
groupTemplate
.
registerTagFactory
(
"dictSelector"
,
new
TagFactory
()
{
@Override
public
Tag
createTag
()
{
return
dictSelectorTag
;
}
});
groupTemplate
.
registerTagFactory
(
"dictSelector"
,
()
->
dictSelectorTag
);
groupTemplate
.
registerFunction
(
"env"
,
new
Function
()
{
@Override
public
String
call
(
Object
[]
paras
,
Context
ctx
)
{
String
key
=
(
String
)
paras
[
0
];
String
key
=
(
String
)
paras
[
0
];
String
value
=
env
.
getProperty
(
key
);
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
return
getStr
(
value
);
}
if
(
paras
.
length
==
2
)
{
return
(
String
)
paras
[
1
];
if
(
paras
.
length
==
2
)
{
return
(
String
)
paras
[
1
];
}
return
null
;
}
protected
String
getStr
(
String
str
)
{
String
getStr
(
String
str
)
{
try
{
return
new
String
(
str
.
getBytes
(
"iso8859-1"
),
"UTF-8"
);
return
new
String
(
str
.
getBytes
(
"iso8859-1"
),
StandardCharsets
.
UTF_8
);
}
catch
(
UnsupportedEncodingException
e
)
{
throw
new
RuntimeException
(
e
);
}
...
...
guns-admin/src/main/java/com/stylefeng/guns/core/beetl/ShiroExt.java
View file @
1616884c
...
...
@@ -15,11 +15,9 @@
*/
package
com
.
stylefeng
.
guns
.
core
.
beetl
;
import
com.stylefeng.guns.core.shiro.ShiroUser
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.subject.Subject
;
import
org.beetl.core.GroupTemplate
;
import
com.stylefeng.guns.core.shiro.ShiroUser
;
public
class
ShiroExt
{
private
static
final
String
NAMES_DELIMETER
=
","
;
...
...
@@ -29,7 +27,7 @@ public class ShiroExt {
*
* @return Subject
*/
p
rotected
static
Subject
getSubject
()
{
p
ublic
static
Subject
getSubject
()
{
return
SecurityUtils
.
getSubject
();
}
...
...
@@ -178,9 +176,4 @@ public class ShiroExt {
return
""
;
}
public
static
void
main
(
String
[]
args
)
{
GroupTemplate
gt
=
new
GroupTemplate
();
gt
.
registerFunctionPackage
(
"shiro"
,
new
ShiroExt
());
}
}
guns-admin/src/main/java/com/stylefeng/guns/core/common/constant/dictmap/base/SystemDict.java
View file @
1616884c
...
...
@@ -10,11 +10,9 @@ public class SystemDict extends AbstractDictMap {
@Override
public
void
init
()
{
}
@Override
protected
void
initBeWrapped
()
{
}
}
guns-admin/src/main/java/com/stylefeng/guns/core/node/ZTreeNode.java
View file @
1616884c
package
com
.
stylefeng
.
guns
.
core
.
node
;
/**
*
* jquery ztree 插件的节点
*
* @author fengshuonan
...
...
@@ -11,13 +10,13 @@ public class ZTreeNode {
private
Long
id
;
//节点id
private
Long
pId
;
//父节点id
private
Long
pId
;
//父节点id
private
String
name
;
//节点名称
private
String
name
;
//节点名称
private
Boolean
open
;
//是否打开节点
private
Boolean
open
;
//是否打开节点
private
Boolean
checked
;
//是否被选中
private
Boolean
checked
;
//是否被选中
public
Long
getId
()
{
return
id
;
...
...
@@ -67,7 +66,7 @@ public class ZTreeNode {
this
.
checked
=
checked
;
}
public
static
ZTreeNode
createParent
()
{
public
static
ZTreeNode
createParent
()
{
ZTreeNode
zTreeNode
=
new
ZTreeNode
();
zTreeNode
.
setChecked
(
true
);
zTreeNode
.
setId
(
0L
);
...
...
guns-admin/src/main/java/com/stylefeng/guns/core/page/PageBT.java
deleted
100644 → 0
View file @
71842f52
package
com
.
stylefeng
.
guns
.
core
.
page
;
/**
* 分页参数类(for BootStrap Table)
*
* @author fengshuonan
* @date 2017年1月21日 下午2:21:35
*/
public
class
PageBT
{
private
int
limit
;
// 每页显示个数
private
int
offset
;
// 查询的偏移量(查询的页数 = offset/limit + 1)
private
String
order
;
// 排序方式
public
PageBT
()
{
super
();
}
public
PageBT
(
int
limit
,
int
offset
)
{
super
();
this
.
limit
=
limit
;
this
.
offset
=
offset
;
}
public
int
getLimit
()
{
return
limit
;
}
public
void
setLimit
(
int
limit
)
{
this
.
limit
=
limit
;
}
public
int
getOffset
()
{
return
offset
;
}
public
void
setOffset
(
int
offset
)
{
this
.
offset
=
offset
;
}
public
String
getOrder
()
{
return
order
;
}
public
void
setOrder
(
String
order
)
{
this
.
order
=
order
;
}
public
int
getPageSize
()
{
return
this
.
limit
;
}
public
int
getPageNumber
()
{
return
this
.
offset
/
this
.
limit
+
1
;
}
@Override
public
String
toString
()
{
return
"PageBT [limit="
+
limit
+
", offset="
+
offset
+
", order="
+
order
+
"]"
;
}
}
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