Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
2380ed79
Commit
2380ed79
authored
Apr 23, 2020
by
ZhengJie
Browse files
Merge branch 'master' of github.com:elunez/eladmin
parents
1a3c0e51
0783648c
Changes
3
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/security/security/TokenProvider.java
View file @
2380ed79
package
me.zhengjie.modules.security.security
;
package
me.zhengjie.modules.security.security
;
import
cn.hutool.core.util.ObjectUtil
;
import
io.jsonwebtoken.*
;
import
io.jsonwebtoken.*
;
import
io.jsonwebtoken.io.Decoders
;
import
io.jsonwebtoken.io.Decoders
;
import
io.jsonwebtoken.security.Keys
;
import
io.jsonwebtoken.security.Keys
;
...
@@ -16,6 +17,7 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -16,6 +17,7 @@ import javax.servlet.http.HttpServletRequest;
import
java.security.Key
;
import
java.security.Key
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -63,10 +65,13 @@ public class TokenProvider implements InitializingBean {
...
@@ -63,10 +65,13 @@ public class TokenProvider implements InitializingBean {
.
parseClaimsJws
(
token
)
.
parseClaimsJws
(
token
)
.
getBody
();
.
getBody
();
// fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException
Object
authoritiesStr
=
claims
.
get
(
AUTHORITIES_KEY
);
Collection
<?
extends
GrantedAuthority
>
authorities
=
Collection
<?
extends
GrantedAuthority
>
authorities
=
Arrays
.
stream
(
claims
.
get
(
AUTHORITIES_KEY
).
toString
().
split
(
","
))
ObjectUtil
.
isNotEmpty
(
authoritiesStr
)
?
Arrays
.
stream
(
authoritiesStr
.
toString
().
split
(
","
))
.
map
(
SimpleGrantedAuthority:
:
new
)
.
map
(
SimpleGrantedAuthority:
:
new
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
())
:
Collections
.
emptyList
()
;
User
principal
=
new
User
(
claims
.
getSubject
(),
""
,
authorities
);
User
principal
=
new
User
(
claims
.
getSubject
(),
""
,
authorities
);
...
...
eladmin-system/src/main/resources/template/generator/admin/ServiceImpl.ftl
View file @
2380ed79
...
@@ -130,7 +130,7 @@ public class ${className}ServiceImpl implements ${className}Service {
...
@@ -130,7 +130,7 @@ public class ${className}ServiceImpl implements ${className}Service {
@
O
verride
@
O
verride
//@
C
acheEvict
(
allEntries
=
true
)
//@
C
acheEvict
(
allEntries
=
true
)
public
void
deleteAll
(
$
{
pkColumnType
}
[]
ids
)
{
public
void
deleteAll
(
$
{
pkColumnType
}
[]
ids
)
{
for
(
$
{
pkColumnType
}
id
:
ids
)
{
for
(
$
{
pkColumnType
}
$
{
pkChangeColName
}
:
ids
)
{
$
{
changeClassName
}
R
epository
.deleteById
(
$
{
pkChangeColName
})
;
$
{
changeClassName
}
R
epository
.deleteById
(
$
{
pkChangeColName
})
;
}
}
}
}
...
@@ -153,4 +153,4 @@ public class ${className}ServiceImpl implements ${className}Service {
...
@@ -153,4 +153,4 @@ public class ${className}ServiceImpl implements ${className}Service {
}
}
F
ileUtil
.downloadExcel
(
list
,
response
)
;
F
ileUtil
.downloadExcel
(
list
,
response
)
;
}
}
}
}
\ No newline at end of file
sql/eladmin.sql
View file @
2380ed79
...
@@ -593,7 +593,7 @@ CREATE TABLE `quartz_log` (
...
@@ -593,7 +593,7 @@ CREATE TABLE `quartz_log` (
`params`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
,
`params`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
,
`time`
bigint
(
20
)
NULL
DEFAULT
NULL
,
`time`
bigint
(
20
)
NULL
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
288
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
COMMENT
=
'定时任务日志'
ROW_FORMAT
=
Compact
;
)
ENGINE
=
MyISAM
AUTO_INCREMENT
=
288
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
COMMENT
=
'定时任务日志'
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- ----------------------------
-- Table structure for role
-- Table structure for role
...
...
Write
Preview
Supports
Markdown
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