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
900cda8c
Commit
900cda8c
authored
Apr 08, 2021
by
wzp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
1edac0ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
JwtFilter.java
...a/cn/wisenergy/chnmuseum/party/auth/filter/JwtFilter.java
+3
-4
GlobalExceptionAdvisor.java
...gy/chnmuseum/party/common/mvc/GlobalExceptionAdvisor.java
+2
-2
ShiroConfig.java
...n/java/cn/wisenergy/chnmuseum/party/conf/ShiroConfig.java
+1
-0
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/auth/filter/JwtFilter.java
View file @
900cda8c
...
...
@@ -46,11 +46,10 @@ public class JwtFilter extends BasicHttpAuthenticationFilter {
@Override
protected
boolean
isAccessAllowed
(
ServletRequest
request
,
ServletResponse
response
,
Object
mappedValue
)
{
LOGGER
.
info
(
"isAccessAllowed"
);
//
if (isLoginAttempt(request, response)) {
if
(
isLoginAttempt
(
request
,
response
))
{
//if (!isLoginAttempt(request, response) || !executeLogin(request,response)) {
try
{
executeLogin
(
request
,
response
);
return
true
;
}
catch
(
UnauthorizedException
e
)
{
// response403(request,response);
return
false
;
...
...
@@ -58,8 +57,8 @@ public class JwtFilter extends BasicHttpAuthenticationFilter {
// response401(request, response);
return
false
;
}
//
}
//
return true;
}
return
true
;
}
/**
...
...
src/main/java/cn/wisenergy/chnmuseum/party/common/mvc/GlobalExceptionAdvisor.java
View file @
900cda8c
...
...
@@ -184,7 +184,7 @@ public class GlobalExceptionAdvisor {
public
Object
handleUnauthorizedException
(
UnauthorizedException
exception
)
{
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
validator
.
HttpResult
httpResult
=
new
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
validator
.
HttpResult
();
// 无权限
addResCodeToMap
(
RESPONSE_CODE_ENUM
.
UNAUTHORIZ
ED
,
httpResult
);
addResCodeToMap
(
RESPONSE_CODE_ENUM
.
ACCOUNT_AUTHENTICATION_FAIL
ED
,
httpResult
);
return
httpResult
;
}
...
...
@@ -198,7 +198,7 @@ public class GlobalExceptionAdvisor {
public
Object
handleUnauthenticatedException
(
UnauthenticatedException
exception
)
{
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
validator
.
HttpResult
httpResult
=
new
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
validator
.
HttpResult
();
// 无权限
addResCodeToMap
(
RESPONSE_CODE_ENUM
.
UNAUTHORIZ
ED
,
httpResult
);
addResCodeToMap
(
RESPONSE_CODE_ENUM
.
ACCOUNT_AUTHENTICATION_FAIL
ED
,
httpResult
);
return
httpResult
;
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/conf/ShiroConfig.java
View file @
900cda8c
...
...
@@ -93,6 +93,7 @@ public class ShiroConfig {
filterChainDefinitionMap
.
put
(
"/verifyCode1"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/loginByQrCode"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/doc.html"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/swagger-ui.html"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/404"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/500"
,
"anon"
);
...
...
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