diff --git a/pom.xml b/pom.xml index 9392c069f0e71eba56416ca60634ea6e18402c4a..5c6ebe8e3db58ce5359fefd7fafc9078fb347599 100644 --- a/pom.xml +++ b/pom.xml @@ -489,7 +489,7 @@ zlt-business - + zlt-web zlt-job diff --git a/zlt-commons/zlt-common-core/src/main/java/com/central/common/properties/DataScopeProperties.java b/zlt-commons/zlt-common-core/src/main/java/com/central/common/properties/DataScopeProperties.java index 0b0e5e0a1b7e07fd49a1467be5cfce28c6cf4e6f..2d3720a33aa46fff8d5c13775886615d9092135f 100644 --- a/zlt-commons/zlt-common-core/src/main/java/com/central/common/properties/DataScopeProperties.java +++ b/zlt-commons/zlt-common-core/src/main/java/com/central/common/properties/DataScopeProperties.java @@ -32,26 +32,26 @@ public class DataScopeProperties { */ private Boolean enabledSqlDebug = Boolean.FALSE; /** - * 在includeTables的匹配符中过滤某几个表不需要权限的,仅enabled=true + * 配置那些表不执行权限控制 */ private Set ignoreTables = Collections.emptySet(); /** - * 指定某几条sql不执行权限控制, 仅enabled=true生效 + * 指定那些sql不执行权限控制 */ private Set ignoreSqls = INGORE_SQL_ID; /** - * 指定某几个表接受权限控制,仅enabled=true,默认当开启时全部表 + * 配置那些表执行数据权限控制,默认是*则表示全部 */ private Set includeTables = Collections.singleton("*"); /** - * 指定某几条sql执行权限控制,仅enabled=true生效 + * 指定那些sql执行数据权限控制 * 1. 为空时:所有sql都添加权限控制 * 2. 有值时:只有配置的sql添加权限控制 */ private Set includeSqls = Collections.emptySet(); /** - * 指定需要的字段名 + * 指定创建人id的字段名 */ private String creatorIdColumnName = "creator_id"; diff --git a/zlt-commons/zlt-common-core/src/main/java/com/central/common/utils/LoginUserUtils.java b/zlt-commons/zlt-common-core/src/main/java/com/central/common/utils/LoginUserUtils.java index 3fdf1be4996df848c40baada961cb02861f97129..b05ecdfd58e074fa0d3773a5726eaf53b638308a 100644 --- a/zlt-commons/zlt-common-core/src/main/java/com/central/common/utils/LoginUserUtils.java +++ b/zlt-commons/zlt-common-core/src/main/java/com/central/common/utils/LoginUserUtils.java @@ -8,6 +8,8 @@ import com.central.common.model.SysUser; import org.springframework.security.authentication.AnonymousAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; @@ -66,4 +68,14 @@ public class LoginUserUtils { } return user; } + + public static SysUser getCurrentUser(boolean isFull) { + // 从请求上下文里获取 Request 对象 + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletRequest contextRequest = requestAttributes.getRequest(); + if (contextRequest != null) { + return LoginUserUtils.getCurrentUser(contextRequest, isFull); + } + return null; + } } diff --git a/zlt-web/layui-web/pom.xml b/zlt-web/layui-web/pom.xml index b0cf64fe1b331b5c401535cbd97753d9eb058fd8..a092bf30730bff2f626c8bfeca53397779feb49d 100644 --- a/zlt-web/layui-web/pom.xml +++ b/zlt-web/layui-web/pom.xml @@ -6,7 +6,7 @@ com.zlt zlt-web - 5.4.0 + 5.5.0 layui-web Layui开发的前端 @@ -14,7 +14,6 @@ org.springframework.boot spring-boot-starter-web - 2.5.14 layui-web diff --git a/zlt-web/react-web/pom.xml b/zlt-web/react-web/pom.xml index e71c856c2012f170ac11145a57818de7e2b8b73f..4d8d538757da8de164de09f09d18f708e4b9492c 100644 --- a/zlt-web/react-web/pom.xml +++ b/zlt-web/react-web/pom.xml @@ -5,7 +5,7 @@ zlt-web com.zlt - 5.4.0 + 5.5.0 4.0.0 @@ -22,7 +22,7 @@ spring-boot-starter-web - + \ No newline at end of file