mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-13 22:58:39 +08:00
feat(data/mybatis-plus): 新增防全表更新与删除插件启用配置
This commit is contained in:
@@ -59,6 +59,11 @@ public class MyBatisPlusExtensionProperties {
|
|||||||
*/
|
*/
|
||||||
private PaginationProperties pagination;
|
private PaginationProperties pagination;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用防全表更新与删除插件
|
||||||
|
*/
|
||||||
|
private boolean blockAttackPluginEnabled = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据权限插件配置属性
|
* 数据权限插件配置属性
|
||||||
*/
|
*/
|
||||||
@@ -175,4 +180,12 @@ public class MyBatisPlusExtensionProperties {
|
|||||||
public void setPagination(PaginationProperties pagination) {
|
public void setPagination(PaginationProperties pagination) {
|
||||||
this.pagination = pagination;
|
this.pagination = pagination;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isBlockAttackPluginEnabled() {
|
||||||
|
return blockAttackPluginEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBlockAttackPluginEnabled(boolean blockAttackPluginEnabled) {
|
||||||
|
this.blockAttackPluginEnabled = blockAttackPluginEnabled;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -77,7 +77,9 @@ public class MybatisPlusAutoConfiguration {
|
|||||||
interceptor.addInnerInterceptor(this.paginationInnerInterceptor(paginationProperties));
|
interceptor.addInnerInterceptor(this.paginationInnerInterceptor(paginationProperties));
|
||||||
}
|
}
|
||||||
// 防全表更新与删除插件
|
// 防全表更新与删除插件
|
||||||
interceptor.addInnerInterceptor(new BlockAttackInnerInterceptor());
|
if (properties.isBlockAttackPluginEnabled()) {
|
||||||
|
interceptor.addInnerInterceptor(new BlockAttackInnerInterceptor());
|
||||||
|
}
|
||||||
return interceptor;
|
return interceptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user