Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
JAVA小学生-王铁柱
eladmin
提交
81dd91f5
E
eladmin
项目概览
JAVA小学生-王铁柱
/
eladmin
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
eladmin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
81dd91f5
编写于
12月 21, 2020
作者:
Z
zhengjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[代码优化](v2.6):由于系统现在默认使用 fastjson 序列化,导致了 @JsonIgnore 失效,现使用 @JSONField(serialize = false) 替换
close
https://github.com/elunez/eladmin/issues/548
上级
98838542
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
17 deletion
+18
-17
eladmin-system/src/main/java/me/zhengjie/config/ConfigurerAdapter.java
...m/src/main/java/me/zhengjie/config/ConfigurerAdapter.java
+1
-0
eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/JwtUserDto.java
.../me/zhengjie/modules/security/service/dto/JwtUserDto.java
+8
-8
eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Dept.java
...src/main/java/me/zhengjie/modules/system/domain/Dept.java
+2
-2
eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Menu.java
...src/main/java/me/zhengjie/modules/system/domain/Menu.java
+2
-2
eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Role.java
...src/main/java/me/zhengjie/modules/system/domain/Role.java
+2
-2
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java
.../java/me/zhengjie/modules/system/service/dto/UserDto.java
+3
-3
未找到文件。
eladmin-system/src/main/java/me/zhengjie/config/ConfigurerAdapter.java
浏览文件 @
81dd91f5
...
...
@@ -73,6 +73,7 @@ public class ConfigurerAdapter implements WebMvcConfigurer {
@Override
public
void
configureMessageConverters
(
List
<
HttpMessageConverter
<?>>
converters
)
{
// 使用 fastjson 序列化,会导致 @JsonIgnore 失效,可以使用 @JSONField(serialize = false) 替换
FastJsonHttpMessageConverter
converter
=
new
FastJsonHttpMessageConverter
();
List
<
MediaType
>
supportMediaTypeList
=
new
ArrayList
<>();
supportMediaTypeList
.
add
(
MediaType
.
APPLICATION_JSON_UTF8
);
...
...
eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/JwtUserDto.java
浏览文件 @
81dd91f5
...
...
@@ -15,7 +15,7 @@
*/
package
me.zhengjie.modules.security.service.dto
;
import
com.
fasterxml.jackson.annotation.JsonIgnore
;
import
com.
alibaba.fastjson.annotation.JSONField
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
me.zhengjie.modules.system.service.dto.UserDto
;
...
...
@@ -37,7 +37,7 @@ public class JwtUserDto implements UserDetails {
private
final
List
<
Long
>
dataScopes
;
@J
sonIgnore
@J
SONField
(
serialize
=
false
)
private
final
List
<
GrantedAuthority
>
authorities
;
public
Set
<
String
>
getRoles
()
{
...
...
@@ -45,37 +45,37 @@ public class JwtUserDto implements UserDetails {
}
@Override
@J
sonIgnore
@J
SONField
(
serialize
=
false
)
public
String
getPassword
()
{
return
user
.
getPassword
();
}
@Override
@J
sonIgnore
@J
SONField
(
serialize
=
false
)
public
String
getUsername
()
{
return
user
.
getUsername
();
}
@J
sonIgnore
@J
SONField
(
serialize
=
false
)
@Override
public
boolean
isAccountNonExpired
()
{
return
true
;
}
@J
sonIgnore
@J
SONField
(
serialize
=
false
)
@Override
public
boolean
isAccountNonLocked
()
{
return
true
;
}
@J
sonIgnore
@J
SONField
(
serialize
=
false
)
@Override
public
boolean
isCredentialsNonExpired
()
{
return
true
;
}
@Override
@J
sonIgnore
@J
SONField
(
serialize
=
false
)
public
boolean
isEnabled
()
{
return
user
.
getEnabled
();
}
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Dept.java
浏览文件 @
81dd91f5
...
...
@@ -15,7 +15,7 @@
*/
package
me.zhengjie.modules.system.domain
;
import
com.
fasterxml.jackson.annotation.JsonIgnore
;
import
com.
alibaba.fastjson.annotation.JSONField
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
@@ -44,7 +44,7 @@ public class Dept extends BaseEntity implements Serializable {
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
@J
sonIgnore
@J
SONField
(
serialize
=
false
)
@ManyToMany
(
mappedBy
=
"depts"
)
@ApiModelProperty
(
value
=
"角色"
)
private
Set
<
Role
>
roles
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Menu.java
浏览文件 @
81dd91f5
...
...
@@ -15,7 +15,7 @@
*/
package
me.zhengjie.modules.system.domain
;
import
com.
fasterxml.jackson.annotation.JsonIgnore
;
import
com.
alibaba.fastjson.annotation.JSONField
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
@@ -44,7 +44,7 @@ public class Menu extends BaseEntity implements Serializable {
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
@J
sonIgnore
@J
SONField
(
serialize
=
false
)
@ManyToMany
(
mappedBy
=
"menus"
)
@ApiModelProperty
(
value
=
"菜单角色"
)
private
Set
<
Role
>
roles
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Role.java
浏览文件 @
81dd91f5
...
...
@@ -15,7 +15,7 @@
*/
package
me.zhengjie.modules.system.domain
;
import
com.
fasterxml.jackson.annotation.JsonIgnore
;
import
com.
alibaba.fastjson.annotation.JSONField
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
@@ -47,7 +47,7 @@ public class Role extends BaseEntity implements Serializable {
@ApiModelProperty
(
value
=
"ID"
,
hidden
=
true
)
private
Long
id
;
@J
sonIgnore
@J
SONField
(
serialize
=
false
)
@ManyToMany
(
mappedBy
=
"roles"
)
@ApiModelProperty
(
value
=
"用户"
,
hidden
=
true
)
private
Set
<
User
>
users
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java
浏览文件 @
81dd91f5
...
...
@@ -15,7 +15,7 @@
*/
package
me.zhengjie.modules.system.service.dto
;
import
com.
fasterxml.jackson.annotation.JsonIgnore
;
import
com.
alibaba.fastjson.annotation.JSONField
;
import
lombok.Getter
;
import
lombok.Setter
;
import
me.zhengjie.base.BaseDTO
;
...
...
@@ -55,12 +55,12 @@ public class UserDto extends BaseDTO implements Serializable {
private
String
avatarPath
;
@J
sonIgnore
@J
SONField
(
serialize
=
false
)
private
String
password
;
private
Boolean
enabled
;
@J
sonIgnore
@J
SONField
(
serialize
=
false
)
private
Boolean
isAdmin
=
false
;
private
Date
pwdResetTime
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录