1. 程式人生 > >spring security 獲取登陸使用者資訊

spring security 獲取登陸使用者資訊

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
Authentication auth = SecurityContextHolder.getContext().getAuthentication();