| | |
| | | import cc.mrbird.febs.common.utils.RedisUtils;
|
| | | import cc.mrbird.febs.common.utils.SpringContextUtil;
|
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity;
|
| | | import cn.hutool.core.util.ObjectUtil;
|
| | | import cn.hutool.core.util.StrUtil;
|
| | | import cn.hutool.crypto.asymmetric.KeyType;
|
| | | import cn.hutool.crypto.asymmetric.RSA;
|
| | |
| | |
|
| | | String token = resolveToken(headerToken);
|
| | | if (token == null || AppContants.TIME_OUT.equals(token)) {
|
| | | responseUnAuth(response);
|
| | | return false;
|
| | | }
|
| | |
|
| | | if(ObjectUtil.isEmpty(redisUtils.getString(token))){
|
| | | responseUnAuth(response);
|
| | | return false;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | public static void main(String[] args) {
|
| | | String token = "Xb3pSziGry+DwmaeZZGzKBA0U7pceLyhgUOUV4IQh7RmIvaC0La3u8xIzU6jJyViiB5UmdIbn2aYeUaAvagh8uFGn6Q2yzDKcogReqU4/8rrPu295AIGjazHsYhtA+QQaFQHS2lcuZnjaXr0gCyT51FVJoRAP0GNEmOKzD1FI5w=";
|
| | | String token = "LevMUYpG9zdhHcDuTyfCovvbC7SBrMQG5xdVMsFoFr+wGXeToiy3fextPC9fmJtM0cWYyrs+ktvoDNvKPwFMjAikCvVwm9bjSeX9457mexw8FotWUZqc6WejSP0YDXYKrSix5JtgI7TlKJ154K0gau941+b8czb3SUZhY0kgfgQ=";
|
| | | RSA rsa = new RSA(AppContants.PRIVATE_KEY, null);
|
| | | String[] tokens = StrUtil.split(rsa.decryptStr(token, KeyType.PrivateKey), "_");
|
| | | System.out.print(tokens[0]);
|
| | | System.out.print(tokens[1]);
|
| | | String s = rsa.decryptStr(token, KeyType.PrivateKey);
|
| | |
|
| | | System.out.print(s);
|
| | | // String[] tokens = StrUtil.split(rsa.decryptStr(token, KeyType.PrivateKey), "_");
|
| | | // System.out.print(tokens[0]);
|
| | | // System.out.print(tokens[1]);
|
| | | }
|
| | | }
|