Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
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
liqin
chnmuseum-party
Commits
ab52d363
Commit
ab52d363
authored
May 26, 2021
by
jiawei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改BUG 当用户名修改后 导致当前token根据用户名获取当前用户报空指针异常
parent
9283b537
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
SystemOperationLogService.java
...chnmuseum/party/common/log/SystemOperationLogService.java
+6
-2
BaseController.java
...n/chnmuseum/party/web/controller/base/BaseController.java
+4
-2
No files found.
src/main/java/cn/chnmuseum/party/common/log/SystemOperationLogService.java
View file @
ab52d363
...
@@ -66,8 +66,12 @@ public class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog>
...
@@ -66,8 +66,12 @@ public class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog>
if
(
StringUtils
.
isBlank
(
header
))
{
if
(
StringUtils
.
isBlank
(
header
))
{
throw
new
AuthenticationException
(
"token失效,请重新登录"
);
throw
new
AuthenticationException
(
"token失效,请重新登录"
);
}
}
String
username
=
JwtTokenUtil
.
getUsername
(
header
);
/**
return
userService
.
selectByUsername
(
username
);
* 决绝修改用户名会报错的问题
*/
// String username = JwtTokenUtil.getUsername(header);
String
userId
=
JwtTokenUtil
.
getEmployeeId
(
header
);
return
userService
.
selectById
(
userId
);
}
}
/**
/**
...
...
src/main/java/cn/chnmuseum/party/web/controller/base/BaseController.java
View file @
ab52d363
...
@@ -263,8 +263,10 @@ public class BaseController implements Serializable {
...
@@ -263,8 +263,10 @@ public class BaseController implements Serializable {
* </p>
* </p>
*/
*/
protected
TUser
getcurUser
()
{
protected
TUser
getcurUser
()
{
String
userName
=
getUserName
();
// String userName = getUserName();
TUser
user
=
userService
.
selectByUsername
(
userName
);
String
userId
=
getUserId
();
// TUser user = userService.selectByUsername(userName);
TUser
user
=
userService
.
selectById
(
userId
);
return
user
;
return
user
;
}
}
...
...
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