Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
fangxinjiang
yifu-mvp
Commits
9def8aee
Commit
9def8aee
authored
Jun 13, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
全局异常处理
parent
3e371650
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
YifuUser.java
....cloud.plus.v1/yifu/common/security/service/YifuUser.java
+9
-1
YifuUserDetailsService.java
.../yifu/common/security/service/YifuUserDetailsService.java
+1
-1
No files found.
yifu-common/yifu-common-security/src/main/java/com/yifu.cloud.plus.v1/yifu/common/security/service/YifuUser.java
View file @
9def8aee
...
...
@@ -16,6 +16,7 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
security
.
service
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Getter
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.userdetails.User
;
...
...
@@ -40,19 +41,26 @@ public class YifuUser extends User {
@Getter
private
final
Long
deptId
;
/**
* 用户名称
*/
@Schema
(
title
=
"用户名称"
)
private
String
nickname
;
/**
* 手机号
*/
@Getter
private
final
String
phone
;
public
YifuUser
(
String
id
,
Long
deptId
,
String
username
,
String
password
,
String
phone
,
boolean
enabled
,
public
YifuUser
(
String
id
,
Long
deptId
,
String
username
,
String
nickname
,
String
password
,
String
phone
,
boolean
enabled
,
boolean
accountNonExpired
,
boolean
credentialsNonExpired
,
boolean
accountNonLocked
,
Collection
<?
extends
GrantedAuthority
>
authorities
)
{
super
(
username
,
password
,
enabled
,
accountNonExpired
,
credentialsNonExpired
,
accountNonLocked
,
authorities
);
this
.
id
=
id
;
this
.
deptId
=
deptId
;
this
.
phone
=
phone
;
this
.
nickname
=
nickname
;
}
}
yifu-common/yifu-common-security/src/main/java/com/yifu.cloud.plus.v1/yifu/common/security/service/YifuUserDetailsService.java
View file @
9def8aee
...
...
@@ -68,7 +68,7 @@ public interface YifuUserDetailsService extends UserDetailsService, Ordered {
SysUser
user
=
info
.
getSysUser
();
// 构造security用户
return
new
YifuUser
(
user
.
getUserId
(),
user
.
getDeptId
(),
user
.
getUsername
(),
return
new
YifuUser
(
user
.
getUserId
(),
user
.
getDeptId
(),
user
.
getUsername
(),
user
.
getNickname
(),
SecurityConstants
.
BCRYPT
+
user
.
getPassword
(),
user
.
getPhone
(),
true
,
true
,
true
,
StrUtil
.
equals
(
user
.
getLockFlag
(),
CommonConstants
.
STATUS_NORMAL
),
authorities
);
}
...
...
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