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 7fa826dd
authored
Dec 28, 2020
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
密码校验策略修改
1 parent
db1ed3eb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
shop-core/src/main/java/com/glsx/shop/security/ApiRealm.java
shop-core/src/main/java/com/glsx/shop/security/ApiRealm.java
View file @
7fa826d
...
@@ -2,6 +2,7 @@ package com.glsx.shop.security;
...
@@ -2,6 +2,7 @@ package com.glsx.shop.security;
import
java.util.Set
;
import
java.util.Set
;
import
com.glsx.shop.bean.core.AuthorizationUser
;
import
com.glsx.shop.bean.core.AuthorizationUser
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.apache.shiro.authc.AuthenticationInfo
;
import
org.apache.shiro.authc.AuthenticationInfo
;
import
org.apache.shiro.authc.AuthenticationToken
;
import
org.apache.shiro.authc.AuthenticationToken
;
...
@@ -66,7 +67,9 @@ public class ApiRealm extends AuthorizingRealm {
...
@@ -66,7 +67,9 @@ public class ApiRealm extends AuthorizingRealm {
}
}
try
{
try
{
if
(!
JwtUtil
.
verify
(
token
,
userBean
.
getPassword
()))
{
String
password
=
userBean
.
getPassword
();
// 修改:当前登录用户密码不为空的情况下才进行密码校验
if
(
StringUtils
.
isNotBlank
(
password
)
&&
!
JwtUtil
.
verify
(
token
,
password
))
{
throw
new
AuthenticationException
(
"Username or password error"
);
throw
new
AuthenticationException
(
"Username or password error"
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
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