移除部分无用代码

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 'org.springframework.boot:spring-boot-starter-data-redis'
testImplementation 'org.springframework.security:spring-security-test'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
runtimeOnly 'org.postgresql:postgresql'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.6'

View File

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

View File

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