| | |
| | | } |
| | | |
| | | String loginStr = (String) redisUtils.get(redisKey); |
| | | log.info("当前登陆用户为:{}", loginStr); |
| | | if (StrUtil.isNotBlank(loginStr)) { |
| | | MemberEntity loginUser = JSONObject.parseObject(loginStr, MemberEntity.class); |
| | | Authentication authentication = new UsernamePasswordAuthenticationToken(loginUser, token, new ArrayList<>()); |
| | |
| | | String rsaToken = bearerToken.replace(AppContants.TOKEN_START_WITH, ""); |
| | | RSA rsa = new RSA(securityProperties.getPrivateKey(), null); |
| | | String[] tokens = StrUtil.split(rsa.decryptStr(rsaToken, KeyType.PrivateKey), "_"); |
| | | |
| | | if (verifyTokenExpired(Long.parseLong(tokens[1]))) { |
| | | return tokens[0]; |
| | | } |
| | | log.info("前面token为{}", tokens[0]); |
| | | log.info("时间为:{}, 当前时间为:{}", tokens[1], System.currentTimeMillis()); |
| | | return null; |
| | | } |
| | | log.info("bearerToken---->{}", bearerToken); |
| | | } catch (Exception e) { |
| | | log.error("#解析token异常#", e); |
| | | return null; |