Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Jeepay
Commits
3157a48e
Commit
3157a48e
authored
Jun 16, 2021
by
terrfly
Browse files
解决密码输入有误提示错误的问题;
parent
a0fcb7f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/service/AuthService.java
View file @
3157a48e
...
...
@@ -33,6 +33,7 @@ import com.jeequan.jeepay.service.mapper.SysEntitlementMapper;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.authentication.AuthenticationManager
;
import
org.springframework.security.authentication.BadCredentialsException
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.AuthenticationException
;
...
...
@@ -81,10 +82,13 @@ public class AuthService {
authentication
=
authenticationManager
.
authenticate
(
upToken
);
}
catch
(
JeepayAuthenticationException
jex
)
{
throw
jex
.
getBizException
()
==
null
?
new
BizException
(
jex
.
getMessage
())
:
jex
.
getBizException
();
}
catch
(
BadCredentialsException
e
)
{
throw
new
BizException
(
"用户名/密码错误!"
);
}
catch
(
AuthenticationException
e
)
{
log
.
error
(
"AuthenticationException:"
,
e
);
throw
new
BizException
(
"认证服务出现异常, 请重试或联系系统管理员!"
);
}
JeeUserDetails
jeeUserDetails
=
(
JeeUserDetails
)
authentication
.
getPrincipal
();
//验证通过后 再查询用户角色和权限信息集合
...
...
jeepay-merchant/src/main/java/com/jeequan/jeepay/mch/service/AuthService.java
View file @
3157a48e
...
...
@@ -35,6 +35,7 @@ import com.jeequan.jeepay.service.mapper.SysEntitlementMapper;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.authentication.AuthenticationManager
;
import
org.springframework.security.authentication.BadCredentialsException
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.AuthenticationException
;
...
...
@@ -83,6 +84,8 @@ public class AuthService {
authentication
=
authenticationManager
.
authenticate
(
upToken
);
}
catch
(
JeepayAuthenticationException
jex
)
{
throw
jex
.
getBizException
()
==
null
?
new
BizException
(
jex
.
getMessage
())
:
jex
.
getBizException
();
}
catch
(
BadCredentialsException
e
)
{
throw
new
BizException
(
"用户名/密码错误!"
);
}
catch
(
AuthenticationException
e
)
{
log
.
error
(
"AuthenticationException:"
,
e
);
throw
new
BizException
(
"认证服务出现异常, 请重试或联系系统管理员!"
);
...
...
Write
Preview
Supports
Markdown
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