Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fzm-joying
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
lei
fzm-joying
Commits
343af48e
Commit
343af48e
authored
May 24, 2022
by
33
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 申请日志BUG
parent
a44a00e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
AuthenticationInterceptor.java
...com/fzm/common/interceptor/AuthenticationInterceptor.java
+15
-0
CopyrightLogServiceImpl.java
.../com/fzm/common/service/impl/CopyrightLogServiceImpl.java
+2
-2
No files found.
joying-common/src/main/java/com/fzm/common/interceptor/AuthenticationInterceptor.java
View file @
343af48e
...
...
@@ -5,10 +5,14 @@ import com.fzm.common.annotation.Authentication;
import
com.fzm.common.constant.RedisConstant
;
import
com.fzm.common.constant.TokenConstant
;
import
com.fzm.common.entity.Admin
;
import
com.fzm.common.entity.AuthPerson
;
import
com.fzm.common.entity.User
;
import
com.fzm.common.enums.AuthStatus
;
import
com.fzm.common.enums.AuthType
;
import
com.fzm.common.enums.ResultCode
;
import
com.fzm.common.exception.GlobalException
;
import
com.fzm.common.service.AdminService
;
import
com.fzm.common.service.AuthPersonService
;
import
com.fzm.common.service.UserService
;
import
com.fzm.common.utils.JwtUtil
;
import
com.fzm.common.utils.RedisUtil
;
...
...
@@ -34,6 +38,8 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
private
UserService
userService
;
@Resource
private
AdminService
adminService
;
@Resource
private
AuthPersonService
authPersonService
;
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
...
...
@@ -76,6 +82,15 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
redisToken
=
redisUtil
.
get
(
RedisConstant
.
PORTAL_USER_TOKEN_PREFIX
+
userId
);
roleId
=
null
;
username
=
null
;
if
(
AuthStatus
.
SUCCESS
.
getStatus
().
equals
(
user
.
getAuthStatus
()))
{
// 个人认证
if
(
AuthType
.
PERSON
.
getType
().
equals
(
user
.
getAuthType
()))
{
AuthPerson
authPerson
=
authPersonService
.
getByUserId
(
user
.
getId
());
username
=
authPerson
.
getName
();
}
//TODO 企业认证
}
}
else
{
// 后台管理用户
Admin
admin
=
adminService
.
getById
(
userId
);
...
...
joying-common/src/main/java/com/fzm/common/service/impl/CopyrightLogServiceImpl.java
View file @
343af48e
...
...
@@ -26,7 +26,7 @@ public class CopyrightLogServiceImpl extends ServiceImpl<CopyrightLogMapper, Cop
public
void
save
(
Integer
cid
,
CopyrightLogType
copyrightLogType
,
String
opInfo
)
{
CopyrightLog
copyrightLog
=
new
CopyrightLog
();
copyrightLog
.
setCopyrightId
(
cid
);
copyrightLog
.
set
Copyright
Id
(
copyrightLogType
.
getId
());
copyrightLog
.
set
OpType
Id
(
copyrightLogType
.
getId
());
copyrightLog
.
setOpType
(
copyrightLogType
.
getType
());
copyrightLog
.
setOpInfo
(
opInfo
);
copyrightLog
.
setOpUserId
(
LoginUserInfo
.
getLoginUser
().
getUserId
());
...
...
@@ -45,7 +45,7 @@ public class CopyrightLogServiceImpl extends ServiceImpl<CopyrightLogMapper, Cop
CopyrightLog
copyrightLog
=
new
CopyrightLog
();
copyrightLog
.
setCopyrightId
(
cid
);
copyrightLog
.
set
Copyright
Id
(
logType
.
getId
());
copyrightLog
.
set
OpType
Id
(
logType
.
getId
());
copyrightLog
.
setOpType
(
logType
.
getType
());
copyrightLog
.
setOpInfo
(
opInfo
);
copyrightLog
.
setOpUserId
(
0
);
...
...
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