移除部分无用代码

This commit is contained in:
05412 2024-07-17 23:20:05 +08:00
parent 53b38a3307
commit 17bcde7a8e
3 changed files with 1 additions and 6 deletions

View File

@ -49,8 +49,6 @@ dependencies {
implementation 'io.jsonwebtoken:jjwt-api:0.12.6' implementation 'io.jsonwebtoken:jjwt-api:0.12.6'
implementation 'org.springframework.boot:spring-boot-starter-data-redis' implementation 'org.springframework.boot:spring-boot-starter-data-redis'
testImplementation 'org.springframework.security:spring-security-test' testImplementation 'org.springframework.security:spring-security-test'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.boot:spring-boot-starter-test'
runtimeOnly 'org.postgresql:postgresql' runtimeOnly 'org.postgresql:postgresql'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.6' runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.6'

View File

@ -1,6 +1,5 @@
package dev.surl.surl.controller package dev.surl.surl.controller
import dev.surl.surl.cfg.logger
import dev.surl.surl.common.Msg import dev.surl.surl.common.Msg
import dev.surl.surl.service.SurlService import dev.surl.surl.service.SurlService
import dev.surl.surl.util.JwtTokenUtil import dev.surl.surl.util.JwtTokenUtil
@ -16,9 +15,7 @@ class SurlGetController(
) { ) {
@GetMapping(path = ["/api/surl/get"]) @GetMapping(path = ["/api/surl/get"])
fun getUrlsByUser(@RequestHeader headers: HttpHeaders): Msg<List<String>> { fun getUrlsByUser(@RequestHeader headers: HttpHeaders): Msg<List<String>> {
logger().logger().info("headers: $headers")
val token = jwtTokenUtil.getTokenFromHeader(headers[HttpHeaders.AUTHORIZATION]?.last() ?: "") val token = jwtTokenUtil.getTokenFromHeader(headers[HttpHeaders.AUTHORIZATION]?.last() ?: "")
logger().logger().info("token: $token")
val username = jwtTokenUtil.getUsernameFromToken(token) val username = jwtTokenUtil.getUsernameFromToken(token)
val urls = surlService.getUrlsByUser(username) val urls = surlService.getUrlsByUser(username)
return Msg(value = urls) return Msg(value = urls)

View File

@ -41,7 +41,7 @@ spring:
logging: logging:
level: level:
root: info root: info
Exposed: info Exposed: debug
base: base:
configs: configs:
site: http://127.0.0.1:18888 site: http://127.0.0.1:18888