Merge pull request #497 from shenchunping/dev

fix: 修复getLoginId,默认值空报错
This commit is contained in:
click33
2023-08-04 16:36:48 +08:00
committed by GitHub

View File

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