| | |
| | | //invite_id_时间戳 例如:45656161_4554848489的加密 |
| | | String token = params.get("token"); |
| | | if (StrUtil.isNotBlank(token)) { |
| | | String inviteId = token; |
| | | // String inviteId = resolveToken(token); |
| | | // String inviteId = token; |
| | | String inviteId = resolveToken(token); |
| | | log.info("----->{}", inviteId); |
| | | if (StrUtil.isBlank(inviteId) || AppContants.TIME_OUT.equals(inviteId)) { |
| | | return false; |
| | |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | RSA rsa = new RSA(null, AppContants.PUBLIC_KEY); |
| | | String token = rsa.encryptBase64("45" + "_" + System.currentTimeMillis(), KeyType.PublicKey); |
| | | System.out.println(token); |
| | | |
| | | |
| | | RSA rsas = new RSA(AppContants.PRIVATE_KEY, null); |
| | | String[] tokens = StrUtil.split(rsas.decryptStr(token, KeyType.PrivateKey), "_"); |
| | | |
| | | System.out.println(tokens); |
| | | } |
| | | |
| | | private Boolean verifyTokenExpired(Long time) { |
| | | boolean isDebug = false; |
| | | if (!isDebug) { |