正在显示
1 个修改的文件
包含
3 行增加
和
0 行删除
@@ -26,6 +26,7 @@ import io.swagger.annotations.ApiImplicitParam; | @@ -26,6 +26,7 @@ import io.swagger.annotations.ApiImplicitParam; | ||
26 | import io.swagger.annotations.ApiImplicitParams; | 26 | import io.swagger.annotations.ApiImplicitParams; |
27 | import io.swagger.annotations.ApiOperation; | 27 | import io.swagger.annotations.ApiOperation; |
28 | import lombok.extern.slf4j.Slf4j; | 28 | import lombok.extern.slf4j.Slf4j; |
29 | +import org.apache.commons.lang.StringUtils; | ||
29 | import org.springframework.beans.factory.annotation.Autowired; | 30 | import org.springframework.beans.factory.annotation.Autowired; |
30 | import org.springframework.context.annotation.Bean; | 31 | import org.springframework.context.annotation.Bean; |
31 | import org.springframework.security.core.context.SecurityContextHolder; | 32 | import org.springframework.security.core.context.SecurityContextHolder; |
@@ -105,8 +106,10 @@ public class UserController { | @@ -105,8 +106,10 @@ public class UserController { | ||
105 | //删除用户token缓存 及时生效锁定账号 | 106 | //删除用户token缓存 及时生效锁定账号 |
106 | if (i>0){ | 107 | if (i>0){ |
107 | String userTokenStr = redisUtils.get(KakoUser.TOKEN_KEY + user.getLoginName()); | 108 | String userTokenStr = redisUtils.get(KakoUser.TOKEN_KEY + user.getLoginName()); |
109 | + if (StringUtils.isNotEmpty(userTokenStr)){ | ||
108 | redisUtils.del(userTokenStr); | 110 | redisUtils.del(userTokenStr); |
109 | } | 111 | } |
112 | + } | ||
110 | return i==1 ? new ResultJson("200","success") :new ResultJson("500","lock user faild"); | 113 | return i==1 ? new ResultJson("200","success") :new ResultJson("500","lock user faild"); |
111 | 114 | ||
112 | } | 115 | } |
-
请 注册 或 登录 后发表评论