parent
34170da97c
commit
dc2f936e99
@ -0,0 +1,12 @@
|
|||||||
|
package org.sang.utils;
|
||||||
|
|
||||||
|
import org.sang.bean.User;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
|
||||||
|
|
||||||
|
public class Util {
|
||||||
|
public static User getCurrentUser() {
|
||||||
|
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue