Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
OSmall
/
linjiashop
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d4ce2826
authored
Dec 28, 2020
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加日志
1 parent
6a86d4d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
shop-core/src/main/java/com/glsx/shop/security/UserService.java
shop-core/src/main/java/com/glsx/shop/security/UserService.java
View file @
d4ce282
...
...
@@ -21,6 +21,7 @@ import com.glsx.shop.dao.system.UserRepository;
import
com.glsx.shop.service.system.impl.ConstantFactory
;
import
com.glsx.shop.utils.Convert
;
import
com.glsx.shop.utils.HttpUtil
;
import
com.glsx.shop.utils.JsonUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -64,6 +65,9 @@ public class UserService {
String
token
=
HttpUtil
.
getToken
();
AuthorizationUser
userBean
=
tokenCache
.
getUser
(
token
);
this
.
logger
.
info
(
"$$$$ getAuthorizationInfo account: {}, userBean = {}"
,
account
,
JsonUtil
.
toJson
(
userBean
));
if
(
userBean
!=
null
)
{
return
userBean
;
}
...
...
@@ -71,6 +75,7 @@ public class UserService {
//构建后台用户认证信息
if
(
userType
==
JwtUser
.
MANAGER
)
{
User
user
=
userRepository
.
findByAccount
(
account
);
this
.
logger
.
info
(
"$$$$ getAuthorizationInfo manager = {}"
,
JsonUtil
.
toJson
(
user
));
userBean
.
setId
(
user
.
getId
());
userBean
.
setAccount
(
user
.
getAccount
());
userBean
.
setDeptId
(
user
.
getDeptid
());
...
...
@@ -102,6 +107,8 @@ public class UserService {
if
(
userType
==
JwtUser
.
FRONT_USER
)
{
// 修改:使用 platform_user 表里面的用户信息进行校验
PlatformUser
platformUser
=
this
.
platformUserRepository
.
findByContactNumber
(
account
);
this
.
logger
.
info
(
"$$$$ getAuthorizationInfo frontUser = {}"
,
JsonUtil
.
toJson
(
platformUser
));
userBean
.
setId
(
platformUser
.
getId
());
userBean
.
setAccount
(
platformUser
.
getContactNumber
());
userBean
.
setPassword
(
platformUser
.
getRemark
());
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment