diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisInterceptor.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisInterceptor.java index aef2266..43fe118 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisInterceptor.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisInterceptor.java @@ -192,7 +192,9 @@ public class MybatisInterceptor implements Interceptor { private LoginUser getLoginUser() { LoginUser sysUser = null; try { - sysUser = SecurityUtils.getSubject().getPrincipal() != null ? (LoginUser) SecurityUtils.getSubject().getPrincipal() : null; + if (SecurityUtils.getSubject().getPrincipal() != null && SecurityUtils.getSubject().getPrincipal() instanceof LoginUser){ + sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + } } catch (Exception e) { //e.printStackTrace(); sysUser = null;