From de91c84954157bb9f8b6d938cbe0b1b51fb6e65d Mon Sep 17 00:00:00 2001 From: CeDo <cedoogle@gmail.com> Date: 星期五, 07 五月 2021 15:23:57 +0800 Subject: [PATCH] bugfixed:新增便民服务商家 报错 --- springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/handel/UserAuthenticationProvider.java | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/handel/UserAuthenticationProvider.java b/springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/handel/UserAuthenticationProvider.java index 23cf075..6769438 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/handel/UserAuthenticationProvider.java +++ b/springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/handel/UserAuthenticationProvider.java @@ -40,7 +40,7 @@ // 查询用户是否存在 R<LoginUserInfoVO> r = userService.getUserInfo(userName); if (r.getCode()!=200) { - throw new UsernameNotFoundException("用户名不存在"); + throw new UsernameNotFoundException("该账号不存在"); } LoginUserInfoVO loginUserInfoVO = r.getData(); List<GrantedAuthority> grantedAuthorityList=new ArrayList<>(); @@ -51,7 +51,7 @@ }); } if (ObjectUtils.isEmpty(loginUserInfoVO.getAccount())) { - throw new UsernameNotFoundException("用户名不存在"); + throw new UsernameNotFoundException("该账号不存在"); } // 我们还要判断密码是否正确,这里我们的密码使用BCryptPasswordEncoder进行加密的 if (!new BCryptPasswordEncoder().matches(password, loginUserInfoVO.getPassword())) { @@ -61,6 +61,8 @@ if (loginUserInfoVO.getStatus().intValue()==2) { throw new LockedException("该用户已被禁用"); } +// 维护最后登录时间 + userService.putUserLastLoginTime(loginUserInfoVO.getUserId()); return new UsernamePasswordAuthenticationToken(loginUserInfoVO, password, grantedAuthorityList); } -- Gitblit v1.7.1