Skip to content

Commit 9f6d697

Browse files
author
“whgojp”
committed
add SPringSecurity support and optimize UI page
1 parent 3bcb06c commit 9f6d697

File tree

165 files changed

+72172
-757
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+72172
-757
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ build/
3535
.vscode/
3636

3737
### Mac OS ###
38-
.DS_Store
38+
.DS_Store
39+
40+
/log/

.idea/dataSources.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/mybatisx/templates.xml

Lines changed: 86 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM ubuntu:latest
2+
LABEL authors="whgojp"
3+
4+
ENTRYPOINT ["top", "-b"]

docker-compose.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: "3"
2+
networks:
3+
driver-all-network:
4+
external: true
5+
6+
services:
7+
nps:
8+
image: ffdfgdfg/nps:v0.26.10
9+
container_name: nps
10+
hostname: nps
11+
restart: always
12+
ports:
13+
- 80:80
14+
- 443:443
15+
- 8080:8080
16+
- 18024:8024
17+
- 8011-8051:8011-8051
18+
volumes:
19+
- /etc/nps/conf:/conf
20+
privileged: true
21+
environment:
22+
TZ: Asia/Shanghai
23+
LANG: en_US.UTF-8
24+
# networks:
25+
# driver-all-network:
26+
# ipv4_address: "172.30.1.2"

log/2024-05-17/info.log

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,3 +608,28 @@
608608
2024-05-17 20:56:46.980 [RMI TCP Connection(2)-192.168.1.141] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
609609
2024-05-17 20:56:46.980 [RMI TCP Connection(2)-192.168.1.141] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
610610
2024-05-17 20:56:46.981 [RMI TCP Connection(2)-192.168.1.141] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 0 ms
611+
2024-05-17 21:36:02.504 [main] INFO top.whgojp.Application - Starting Application using Java 1.8.0_382 on MacBook-Pro with PID 32467 (/Users/whgojp/Desktop/Security/JAVA/JavaSecLab/target/classes started by whgojp in /Users/whgojp/Desktop/Security/JAVA/JavaSecLab)
612+
2024-05-17 21:36:02.505 [main] INFO top.whgojp.Application - The following 1 profile is active: "dev"
613+
2024-05-17 21:36:02.945 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http)
614+
2024-05-17 21:36:02.950 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8080"]
615+
2024-05-17 21:36:02.951 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
616+
2024-05-17 21:36:02.951 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.78]
617+
2024-05-17 21:36:02.988 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
618+
2024-05-17 21:36:02.988 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 463 ms
619+
2024-05-17 21:36:03.113 [main] INFO o.s.b.a.web.servlet.WelcomePageHandlerMapping - Adding welcome page: class path resource [static/index.html]
620+
2024-05-17 21:36:03.280 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8080"]
621+
2024-05-17 21:36:03.290 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path ''
622+
2024-05-17 21:36:03.319 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 9090 (http)
623+
2024-05-17 21:36:03.320 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-9090"]
624+
2024-05-17 21:36:03.320 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
625+
2024-05-17 21:36:03.320 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.78]
626+
2024-05-17 21:36:03.324 [main] INFO o.a.c.c.ContainerBase.[Tomcat-1].[localhost].[/] - Initializing Spring embedded WebApplicationContext
627+
2024-05-17 21:36:03.324 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 32 ms
628+
2024-05-17 21:36:03.330 [main] INFO o.s.b.actuate.endpoint.web.EndpointLinksResolver - Exposing 13 endpoint(s) beneath base path '/sys/actuator'
629+
2024-05-17 21:36:03.346 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-9090"]
630+
2024-05-17 21:36:03.347 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 9090 (http) with context path ''
631+
2024-05-17 21:36:03.355 [main] INFO top.whgojp.Application - Started Application in 1.112 seconds (JVM running for 1.494)
632+
2024-05-17 21:36:03.358 [main] INFO top.whgojp.Application - ==================SpringBoot启动成功================
633+
2024-05-17 21:36:03.575 [RMI TCP Connection(1)-172.20.10.4] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
634+
2024-05-17 21:36:03.575 [RMI TCP Connection(1)-172.20.10.4] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
635+
2024-05-17 21:36:03.576 [RMI TCP Connection(1)-172.20.10.4] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 1 ms

pom.xml

Lines changed: 87 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,25 @@
1414
<artifactId>spring-boot-starter-parent</artifactId>
1515
<version>2.7.14</version>
1616
</parent>
17-
17+
<properties>
18+
<maven.compiler.source>8</maven.compiler.source>
19+
<maven.compiler.target>8</maven.compiler.target>
20+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
21+
<swagger.version>3.0.0</swagger.version>
22+
<hutool.version>5.8.21</hutool.version>
23+
<lombok.version>1.18.4</lombok.version>
24+
<mybatis-plus.version>3.5.1</mybatis-plus.version>
25+
<mysql.version>8.0.33</mysql.version>
26+
<esapi.version>2.2.0.0</esapi.version>
27+
<jwt.version>0.10.7</jwt.version>
28+
</properties>
1829
<dependencies>
30+
<!-- 热加载-->
31+
<dependency>
32+
<groupId>org.springframework.boot</groupId>
33+
<artifactId>spring-boot-devtools</artifactId>
34+
</dependency>
35+
1936
<dependency>
2037
<groupId>org.springframework.boot</groupId>
2138
<artifactId>spring-boot-starter-web</artifactId>
@@ -33,17 +50,81 @@
3350
<scope>provided</scope>
3451
</dependency>
3552

36-
<!-- <dependency>-->
37-
<!-- <groupId>org.springframework.boot</groupId>-->
38-
<!-- <artifactId>spring-boot-starter-thymeleaf</artifactId>-->
39-
<!-- </dependency>-->
53+
<dependency>
54+
<groupId>org.springframework.boot</groupId>
55+
<artifactId>spring-boot-starter-security</artifactId>
56+
</dependency>
57+
58+
<!-- JWT -->
59+
<dependency>
60+
<groupId>io.jsonwebtoken</groupId>
61+
<artifactId>jjwt-api</artifactId>
62+
<version>${jwt.version}</version>
63+
</dependency>
64+
<dependency>
65+
<groupId>io.jsonwebtoken</groupId>
66+
<artifactId>jjwt-impl</artifactId>
67+
<version>${jwt.version}</version>
68+
<scope>runtime</scope>
69+
</dependency>
70+
<dependency>
71+
<groupId>io.jsonwebtoken</groupId>
72+
<artifactId>jjwt-jackson</artifactId>
73+
<version>${jwt.version}</version>
74+
<scope>runtime</scope>
75+
</dependency>
76+
77+
<dependency>
78+
<groupId>org.springframework.boot</groupId>
79+
<artifactId>spring-boot-starter-thymeleaf</artifactId>
80+
</dependency>
4081

4182
<!--通过 actuator 检查项目运行情况-->
4283
<dependency>
4384
<groupId>org.springframework.boot</groupId>
4485
<artifactId>spring-boot-starter-actuator</artifactId>
4586
</dependency>
4687

88+
<!-- swagger依赖-->
89+
<dependency>
90+
<groupId>io.springfox</groupId>
91+
<artifactId>springfox-boot-starter</artifactId>
92+
<version>${swagger.version}</version>
93+
</dependency>
94+
<!--Lombok-->
95+
<dependency>
96+
<groupId>org.projectlombok</groupId>
97+
<artifactId>lombok</artifactId>
98+
<version>${lombok.version}</version>
99+
<scope>provided</scope>
100+
</dependency>
101+
<dependency>
102+
<groupId>org.springframework.boot</groupId>
103+
<artifactId>spring-boot-starter-jdbc</artifactId>
104+
</dependency>
105+
<dependency>
106+
<groupId>mysql</groupId>
107+
<artifactId>mysql-connector-java</artifactId>
108+
<version>${mysql.version}</version>
109+
</dependency>
110+
<!-- ORM框架-Mybatis-->
111+
<dependency>
112+
<groupId>com.baomidou</groupId>
113+
<artifactId>mybatis-plus-boot-starter</artifactId>
114+
<version>${mybatis-plus.version}</version>
115+
</dependency>
116+
<!--hutool-->
117+
<dependency>
118+
<groupId>cn.hutool</groupId>
119+
<artifactId>hutool-all</artifactId>
120+
<version>${hutool.version}</version>
121+
</dependency>
122+
<!-- Web安全框架-esapi -->
123+
<dependency>
124+
<groupId>org.owasp.esapi</groupId>
125+
<artifactId>esapi</artifactId>
126+
<version>${esapi.version}</version>
127+
</dependency>
47128

48129
</dependencies>
49130
<repositories>
@@ -59,10 +140,6 @@
59140
</snapshots>
60141
</repository>
61142
</repositories>
62-
<properties>
63-
<maven.compiler.source>8</maven.compiler.source>
64-
<maven.compiler.target>8</maven.compiler.target>
65-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
66-
</properties>
143+
67144

68145
</project>

src/main/java/top/whgojp/Application.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
package top.whgojp;
22

3+
import lombok.SneakyThrows;
34
import lombok.extern.slf4j.Slf4j;
5+
import org.springframework.beans.factory.annotation.Autowired;
46
import org.springframework.boot.SpringApplication;
57
import org.springframework.boot.autoconfigure.SpringBootApplication;
68
import org.springframework.context.annotation.ComponentScan;
9+
import org.springframework.core.io.ResourceLoader;
710
import org.springframework.scheduling.annotation.EnableScheduling;
811

912
@Slf4j
1013
@SpringBootApplication
1114
public class Application {
15+
// @Autowired
16+
// public static ResourceLoader resourceLoader;
17+
// public static String uploadFolder;
18+
19+
// @SneakyThrows
1220
public static void main(String[] args) {
1321
SpringApplication.run(Application.class, args);
22+
// uploadFolder = resourceLoader.getResource("classpath:static/upload/xss/").getFile().getPath();
23+
1424
log.info("==================SpringBoot启动成功================");
1525
}
1626

0 commit comments

Comments
 (0)