style(auth): reorganize imports and reformat controller comments
This commit is contained in:
@@ -9,6 +9,7 @@ import com.msksbr.bookmgr.template.Result
|
||||
import jakarta.servlet.http.HttpServletRequest
|
||||
import jakarta.validation.Valid
|
||||
import org.springframework.web.bind.annotation.PostMapping
|
||||
import org.springframework.web.bind.annotation.RequestAttribute
|
||||
import org.springframework.web.bind.annotation.RequestBody
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
@@ -75,8 +76,12 @@ class AuthController(
|
||||
*/
|
||||
@PostMapping("/logout")
|
||||
fun logout(
|
||||
@RequestAttribute(required = false) username: String?,
|
||||
request: HttpServletRequest
|
||||
): Result<String> {
|
||||
if (username != null) {
|
||||
log.info("[Auth] logout username: {}", username)
|
||||
}
|
||||
log.info("[Auth] logout: ip={}", ipExtractor.getRealIp(request))
|
||||
log.debug("[Auth] user agent: {}", request.getHeader("User-Agent"))
|
||||
// JWT 无状态,登出只需客户端删除 token
|
||||
|
||||
Reference in New Issue
Block a user