KKSU
2024-03-26 c89efafa00ff5ab96d67bc06c558e54963b72f0c
后台修改
7 files modified
157 ■■■■ changed files
src/main/resources/templates/error/403.html 2 ●●● patch | view | raw | blame | history
src/main/resources/templates/error/404.html 2 ●●● patch | view | raw | blame | history
src/main/resources/templates/error/500.html 2 ●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/layout.html 2 ●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/login.html 4 ●●●● patch | view | raw | blame | history
src/main/resources/templates/index.html 2 ●●● patch | view | raw | blame | history
src/test/java/cc/mrbird/febs/JunitTest.java 143 ●●●● patch | view | raw | blame | history
src/main/resources/templates/error/403.html
@@ -2,7 +2,7 @@
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>ANT-LAB 权限系统</title>
    <title>DAPP 权限系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
src/main/resources/templates/error/404.html
@@ -2,7 +2,7 @@
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>ANT-LAB 权限系统</title>
    <title>DAPP 权限系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
src/main/resources/templates/error/500.html
@@ -2,7 +2,7 @@
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>ANT-LAB 权限系统</title>
    <title>DAPP 权限系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
src/main/resources/templates/febs/views/layout.html
@@ -63,7 +63,7 @@
        <div class="layui-side-scroll">
            <div class="layui-logo" style="cursor: pointer">
                <img data-th-src="@{febs/images/logo.png}">
                <span>ANT-LAB 权限系统</span>
                <span>DAPP 权限系统</span>
            </div>
            <script
                    type="text/html"
src/main/resources/templates/febs/views/login.html
@@ -2,7 +2,7 @@
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>ANT-LAB 权限系统</title>
    <title>DAPP 权限系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@@ -19,7 +19,7 @@
        <div class="layui-container">
            <div class="layui-row">
                <div class="layui-col-xs12 layui-col-lg4 layui-col-lg-offset4 febs-tc">
                    <div class="layui-logo"><span><b>ANT-LAB</b> 权限系统</span></div>
                    <div class="layui-logo"><span><b>DAPP</b> 权限系统</span></div>
                </div>
                <div class="layui-col-xs12 layui-col-lg4 layui-col-lg-offset4" id="login-div">
                    <div class="layui-form" lay-filter="login-form">
src/main/resources/templates/index.html
@@ -3,7 +3,7 @@
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8">
    <title>ANT-LAB 权限系统</title>
    <title>DAPP 权限系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
src/test/java/cc/mrbird/febs/JunitTest.java
@@ -1,77 +1,66 @@
//package cc.mrbird.febs;
//
//import cc.mrbird.febs.common.contants.AppContants;
//import cc.mrbird.febs.dapp.entity.DappMemberEntity;
//import cc.mrbird.febs.dapp.mapper.DappMemberDao;
//import cn.hutool.core.codec.Base64;
//import cn.hutool.core.date.DateTime;
//import cn.hutool.core.date.DateUnit;
//import cn.hutool.core.date.DateUtil;
//import cn.hutool.core.util.CharsetUtil;
//import cn.hutool.core.util.StrUtil;
//import cn.hutool.crypto.SecureUtil;
//import cn.hutool.crypto.asymmetric.KeyType;
//import cn.hutool.crypto.asymmetric.RSA;
//import com.alibaba.fastjson.JSONObject;
//import org.junit.jupiter.api.Test;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.test.context.SpringBootTest;
//
//import java.math.BigDecimal;
//import java.security.KeyPair;
//import java.util.Date;
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * @author
// * @date 2022-03-28
// **/
//@SpringBootTest
//public class JunitTest {
//
//    @Autowired
//    private MineProfitJob mineProfitJob;
//    @Autowired
//    private DappMemberDao dappMemberDao;
//
//    @Test
//    public void incomeTest() {
//        mineProfitJob.start();
//    }
//
//    @Test
//    public void userTest() {
//        DappMemberEntity member = dappMemberDao.selectById(6L);
//        mineProfitJob.calAgentMoney(member, BigDecimal.TEN);
//    }
//
//    public static void main(String[] args) {
//        DateTime tomorrow = DateUtil.beginOfDay(DateUtil.tomorrow());
//        System.out.println(DateUtil.between(new Date(), tomorrow, DateUnit.SECOND, true));
//    }
//
//    public String PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC1cHrcMpXoKNC8rjAa/jAbgU2bhIBmJmn6iYDfqt0Him/p2s5F0L9nfzZOLYlPq3z12zvXl9IgThhtLIBLi86RPW0ljuwpTvIZz9O36Zae9eMk5bMNsFEFsxg1IOLIM2Oc4ffNvGL58Uupp9RL5NCN1MRQyY61ISy7H2VRTznoJQIDAQAB";
//    public String PRIVATE_KEY = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALVwetwylego0LyuMBr+MBuBTZuEgGYmafqJgN+q3QeKb+nazkXQv2d/Nk4tiU+rfPXbO9eX0iBOGG0sgEuLzpE9bSWO7ClO8hnP07fplp714yTlsw2wUQWzGDUg4sgzY5zh9828YvnxS6mn1Evk0I3UxFDJjrUhLLsfZVFPOeglAgMBAAECgYAPKWWS5gVB37tFsRajAs+5VK5MCyABqT8c6QWkay5KNYbRl2+6RM3h068RjFuXlUB9eQMAqpasDWqcIOZdqcKqmxm0ILF2zfPzJr4RaQNSNwDCVrKEeaDtrZQcq/0ygaNDF9y203UMHT0dfEQSGp/xkjTgXNsOuC9iLM56XScOVwJBAPOZLbrCi0h4PL7g3rWsCw8/aN6ehkJ3iTDgjYpdBwJOJSyxV0qi0xmDthGqPd99Kvc14u1jy3ghpm1SAEunrj8CQQC+rS6qajIkK7NiRmX43chDhgMPGo0UFHbmHyYBb1Eyrxu1MNWQEh221p54GsB2HqAGRhxxQ98Ds2S26Au7QpibAkA2nQAAn/8kFzjfPoEPz+uG1puHVZkaK7yJRb7V53dbz/NLqtK8O/cCAGKAYV+PzHsmg2FGAZqrazfpyHmifIx3AkBnFau/+A/JnFKr09F3XTfSwZXPyZPyAipRuQ9MAUmNtDuvloovDIxB9//OgPACLAZpvefMmFvuXUMa25LUF2n3AkBGb+vO+69NSyQM2SHKZ9fUrxx9ZPhupNt/TXNL9OMEQiLaHCYgg0tfcojGe3QjBCA6wVG+dCyZUcv5OwiW23pI";
//
//    @Test
//    public void encodeTest() {
//        RSA rsa = new RSA(AppContants.REQ_PRIVATE_KEY, AppContants.REQ_PUBLIC_KEY);
//        Map<String, Object> map = new HashMap<>();
//        map.put("test", 123);
//        String s = JSONObject.toJSONString(map);
//        String s1 = rsa.encryptBase64(s, KeyType.PublicKey);
//        System.out.println(s1);
//    }
//
//    @Test
//    public void decodeTest() {
//        RSA rsa = new RSA();
//
//        // 公钥加密,私钥解密
//        byte[] encrypt = rsa.encrypt(StrUtil.bytes("我是一段测试aaaa", CharsetUtil.CHARSET_UTF_8), KeyType.PublicKey);
//        byte[] decrypt = rsa.decrypt(encrypt, KeyType.PrivateKey);
//
//        System.out.println(StrUtil.str(decrypt, CharsetUtil.CHARSET_UTF_8));
//    }
//}
package cc.mrbird.febs;
import cc.mrbird.febs.common.contants.AppContants;
import cc.mrbird.febs.dapp.entity.DappMemberEntity;
import cc.mrbird.febs.dapp.mapper.DappMemberDao;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.asymmetric.KeyType;
import cn.hutool.crypto.asymmetric.RSA;
import com.alibaba.fastjson.JSONObject;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.math.BigDecimal;
import java.security.KeyPair;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
 * @author
 * @date 2022-03-28
 **/
@SpringBootTest
public class JunitTest {
    public static void main(String[] args) {
        DateTime tomorrow = DateUtil.beginOfDay(DateUtil.tomorrow());
        System.out.println(DateUtil.between(new Date(), tomorrow, DateUnit.SECOND, true));
    }
    public String PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC1cHrcMpXoKNC8rjAa/jAbgU2bhIBmJmn6iYDfqt0Him/p2s5F0L9nfzZOLYlPq3z12zvXl9IgThhtLIBLi86RPW0ljuwpTvIZz9O36Zae9eMk5bMNsFEFsxg1IOLIM2Oc4ffNvGL58Uupp9RL5NCN1MRQyY61ISy7H2VRTznoJQIDAQAB";
    public String PRIVATE_KEY = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALVwetwylego0LyuMBr+MBuBTZuEgGYmafqJgN+q3QeKb+nazkXQv2d/Nk4tiU+rfPXbO9eX0iBOGG0sgEuLzpE9bSWO7ClO8hnP07fplp714yTlsw2wUQWzGDUg4sgzY5zh9828YvnxS6mn1Evk0I3UxFDJjrUhLLsfZVFPOeglAgMBAAECgYAPKWWS5gVB37tFsRajAs+5VK5MCyABqT8c6QWkay5KNYbRl2+6RM3h068RjFuXlUB9eQMAqpasDWqcIOZdqcKqmxm0ILF2zfPzJr4RaQNSNwDCVrKEeaDtrZQcq/0ygaNDF9y203UMHT0dfEQSGp/xkjTgXNsOuC9iLM56XScOVwJBAPOZLbrCi0h4PL7g3rWsCw8/aN6ehkJ3iTDgjYpdBwJOJSyxV0qi0xmDthGqPd99Kvc14u1jy3ghpm1SAEunrj8CQQC+rS6qajIkK7NiRmX43chDhgMPGo0UFHbmHyYBb1Eyrxu1MNWQEh221p54GsB2HqAGRhxxQ98Ds2S26Au7QpibAkA2nQAAn/8kFzjfPoEPz+uG1puHVZkaK7yJRb7V53dbz/NLqtK8O/cCAGKAYV+PzHsmg2FGAZqrazfpyHmifIx3AkBnFau/+A/JnFKr09F3XTfSwZXPyZPyAipRuQ9MAUmNtDuvloovDIxB9//OgPACLAZpvefMmFvuXUMa25LUF2n3AkBGb+vO+69NSyQM2SHKZ9fUrxx9ZPhupNt/TXNL9OMEQiLaHCYgg0tfcojGe3QjBCA6wVG+dCyZUcv5OwiW23pI";
    @Test
    public void encodeTest() {
        RSA rsa = new RSA(AppContants.REQ_PRIVATE_KEY, AppContants.REQ_PUBLIC_KEY);
        Map<String, Object> map = new HashMap<>();
        map.put("test", 123);
        String s = JSONObject.toJSONString(map);
        String s1 = rsa.encryptBase64(s, KeyType.PublicKey);
        System.out.println(s1);
    }
    @Test
    public void decodeTest() {
        RSA rsas = new RSA(AppContants.REQ_PRIVATE_KEY, AppContants.REQ_PUBLIC_KEY);
        String decryptStr = rsas.decryptStr("read", KeyType.PrivateKey);
        System.out.println(decryptStr);
        System.out.println(StrUtil.str(decryptStr, CharsetUtil.CHARSET_UTF_8));
        RSA rsa = new RSA();
        // 公钥加密,私钥解密
        byte[] encrypt = rsa.encrypt(StrUtil.bytes("我是一段测试aaaa", CharsetUtil.CHARSET_UTF_8), KeyType.PublicKey);
        byte[] decrypt = rsa.decrypt(encrypt, KeyType.PrivateKey);
        System.out.println(StrUtil.str(decrypt, CharsetUtil.CHARSET_UTF_8));
    }
}