Skip to content

Commit 7e609be

Browse files
committed
security
1 parent 5dfaebf commit 7e609be

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ dependencies {
6060
// implementation("com.googlecode.protobuf:protobuf-java-format:1.2")
6161

6262
implementation("org.springframework.boot:spring-boot-starter-web")
63+
implementation("org.springframework.boot:spring-boot-starter-security")
6364
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
6465
implementation("org.jetbrains.kotlin:kotlin-reflect")
6566
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")

src/main/kotlin/net/lz1998/mirai/SpringMiraiClientApplication.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ import net.lz1998.mirai.properties.ClientProperties
44
import org.springframework.boot.autoconfigure.SpringBootApplication
55
import org.springframework.boot.context.properties.EnableConfigurationProperties
66
import org.springframework.boot.runApplication
7-
import org.springframework.context.annotation.Bean
8-
import org.springframework.context.annotation.Configuration
9-
import org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter
7+
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
108

9+
@EnableWebSecurity
1110
@SpringBootApplication
1211
@EnableConfigurationProperties(ClientProperties::class)
1312
class SpringMiraiClientApplication

src/main/resources/application.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@ server:
22
port: 9000
33
bot:
44
client:
5-
ws-url: "ws://localhost:8081/ws/test/"
5+
ws-url: "ws://localhost:8081/ws/test/"
6+
7+
spring:
8+
security:
9+
user:
10+
name: admin
11+
password: 123456

src/main/resources/static/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>机器人管理</title>
6+
</head>
7+
<body>
8+
<div>请检查前端文件是否缺失。</div>
9+
<div>可以去<a href="https://github.com/protobufbot/spring-mirai-client-ui">这里</a>找到前端项目。</div>
10+
</body>
11+
</html>

0 commit comments

Comments
 (0)