优化 StpLogic#getLoginId 返回值逻辑

This commit is contained in:
click33
2023-08-04 16:51:21 +08:00
parent 45fcfc5e8e
commit e30f4df048

View File

@@ -994,12 +994,11 @@ public class StpLogic {
if(loginId == null) {
return defaultValue;
}
// 3、不为 null则开始尝试类型转换
if (defaultValue != null) {
return (T) SaFoxUtil.getValueByType(loginId, defaultValue.getClass());
} else {
return (T) SaFoxUtil.getValueByType(loginId, Object.class);
// 3、loginId 不为 null则开始尝试类型转换
if (defaultValue == null) {
return null;
}
return (T) SaFoxUtil.getValueByType(loginId, defaultValue.getClass());
}
/**