package top.continew.admin;

import cn.dev33.satoken.jwt.SaJwtTemplate;
import cn.hutool.jwt.JWT;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.ArrayList;
import java.util.List;

@SpringBootTest
class ContiNewAdminApplicationTests {

    @Test
    void contextLoads() {
        List list = new ArrayList();
        list.add("w2003210611"); //3ba204d7428a6711c0ecbb4f7aff56a1
        //I/4/Z2qtuAf/8UXEVnMk9dH3DtZbxq8haFbZmqngQ/gCHSMT7cBcE36daVF6cG2zwRRcnTL/FNwcuIxYis3ZbA==
        //List list1 = SecureUtils.encryptFieldByAes(list);
        //String s = SecureUtils.decryptByRsaPrivateKey("I/4/Z2qtuAf/8UXEVnMk9dH3DtZbxq8haFbZmqngQ/gCHSMT7cBcE36daVF6cG2zwRRcnTL/FNwcuIxYis3ZbA==");

        String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOjY0NDEwODAyMjk1OTgzNzIzMCwicm5TdHIiOiIza0kxakdkcGx6bVE2dk5WQU9QdUtYNFhxU1VpbmtLdyJ9.9HnsngOmI2GgGNa2kGW2MXEl3RL5wZbS6sOY7sB1aFc";
        String keyt = "asdasdasifhueuiwyurfewbfjsdafjk";

        SaJwtTemplate saJwtTemplate = new SaJwtTemplate();
        JWT login = saJwtTemplate.parseToken(token, "login", keyt, false);
        System.out.println(login.getPayloads());
    }
}
