优化判断逻辑
This commit is contained in:
+2
@@ -113,6 +113,7 @@ public class AuthUtils {
|
|||||||
public static String getAccountType(Authentication authentication) {
|
public static String getAccountType(Authentication authentication) {
|
||||||
Object details = authentication.getDetails();
|
Object details = authentication.getDetails();
|
||||||
String accountType = null;
|
String accountType = null;
|
||||||
|
if (details != null) {
|
||||||
if (details instanceof CustomWebAuthenticationDetails) {
|
if (details instanceof CustomWebAuthenticationDetails) {
|
||||||
CustomWebAuthenticationDetails detailsObj = (CustomWebAuthenticationDetails) details;
|
CustomWebAuthenticationDetails detailsObj = (CustomWebAuthenticationDetails) details;
|
||||||
accountType = detailsObj.getAccountType();
|
accountType = detailsObj.getAccountType();
|
||||||
@@ -122,6 +123,7 @@ public class AuthUtils {
|
|||||||
accountType = detailsMap.get(SecurityConstants.ACCOUNT_TYPE_PARAM_NAME);
|
accountType = detailsMap.get(SecurityConstants.ACCOUNT_TYPE_PARAM_NAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return accountType;
|
return accountType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user