用户状态
This commit is contained in:
parent
32b0b24945
commit
bf3b249107
|
|
@ -49,6 +49,21 @@ public class AppApiMethodAspect {
|
||||||
@Around("pkg()")
|
@Around("pkg()")
|
||||||
public Object around(ProceedingJoinPoint pjp) throws Throwable {
|
public Object around(ProceedingJoinPoint pjp) throws Throwable {
|
||||||
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
|
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
|
||||||
|
String token = request.getHeader("token");
|
||||||
|
if (StringUtils.isNotBlank(token)) {
|
||||||
|
Claims claims = jwtUtils.getClaimByToken(token);
|
||||||
|
if (claims != null && !jwtUtils.isTokenExpired(claims.getExpiration())) {
|
||||||
|
Long userId = Long.parseLong(claims.getSubject());
|
||||||
|
UserEntity userInfo = userService.selectUserById(userId);
|
||||||
|
if (userInfo == null) {
|
||||||
|
throw new CzgException("用户不存在");
|
||||||
|
} else if (userInfo.getStatus() == 0) {
|
||||||
|
throw new UserException("用户被拉黑", 701);
|
||||||
|
} else if (userInfo.getStatus() == 2) {
|
||||||
|
throw new UserException("用户被禁用", 702);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
//避免回填
|
//避免回填
|
||||||
Object[] args = pjp.getArgs();
|
Object[] args = pjp.getArgs();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue