Merge branch 'master' into leng_dev
This commit is contained in:
commit
b4272980c0
6 files changed
+9
-35
No files matched your search
-26
@@ -62,37 +62,11 @@ public class SecurityUtils {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用名
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getUsername() {
|
||||
Object principal = getAuthentication().getPrincipal();
|
||||
if (principal instanceof String) {
|
||||
return principal.toString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public String getClientId() {
|
||||
Authentication authentication = getAuthentication();
|
||||
if (authentication instanceof OAuth2Authentication) {
|
||||
OAuth2Authentication auth2Authentication = (OAuth2Authentication) authentication;
|
||||
return auth2Authentication.getOAuth2Request().getClientId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户
|
||||
*/
|
||||
public PigxUser getUser() {
|
||||
Authentication authentication = getAuthentication();
|
||||
if (authentication == null) {
|
||||
return null;
|
||||
}
|
||||
return getUser(authentication);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ import java.util.Objects;
|
||||
/**
|
||||
* @author lengleng
|
||||
* <p>
|
||||
* fallBack 代理处理
|
||||
* fallback 代理处理
|
||||
*/
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
|
||||
Reference in new issue
Block a user