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
commit 45fcfc5e8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);
}
} }
/** /**