作者 朱兆平

add: 修复用户锁定bug

... ... @@ -26,6 +26,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.security.core.context.SecurityContextHolder;
... ... @@ -105,7 +106,9 @@ public class UserController {
//删除用户token缓存 及时生效锁定账号
if (i>0){
String userTokenStr = redisUtils.get(KakoUser.TOKEN_KEY + user.getLoginName());
redisUtils.del(userTokenStr);
if (StringUtils.isNotEmpty(userTokenStr)){
redisUtils.del(userTokenStr);
}
}
return i==1 ? new ResultJson("200","success") :new ResultJson("500","lock user faild");
... ...