Skip to content

Commit 9ee2427

Browse files
committed
fix 3.3.45
1 parent 8bebd9f commit 9ee2427

File tree

1 file changed

+9
-11
lines changed
  • springboot-starter-data-authorization/src/main/java/com/codingapi/springboot/authorization/interceptor

1 file changed

+9
-11
lines changed

springboot-starter-data-authorization/src/main/java/com/codingapi/springboot/authorization/interceptor/SQLRunningContext.java

+9-11
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,19 @@ public SQLInterceptState intercept(String sql) throws SQLException {
3030
if (skipInterceptor.get()) {
3131
return SQLInterceptState.unIntercept(sql);
3232
}
33-
34-
if (sqlInterceptor.beforeHandler(sql)) {
35-
// 在拦截器中执行的查询操作将不会被拦截
36-
skipInterceptor.set(true);
37-
try {
33+
try {
34+
if (sqlInterceptor.beforeHandler(sql)) {
35+
// 在拦截器中执行的查询操作将不会被拦截
36+
skipInterceptor.set(true);
3837
DataPermissionSQL dataPermissionSQL = sqlInterceptor.postHandler(sql);
3938
sqlInterceptor.afterHandler(sql, dataPermissionSQL.getNewSql(), null);
4039
return SQLInterceptState.intercept(sql, dataPermissionSQL.getNewSql(), dataPermissionSQL.getAliasContext());
41-
} catch (SQLException exception) {
42-
sqlInterceptor.afterHandler(sql, null, exception);
43-
throw exception;
44-
} finally {
45-
// 重置拦截器状态
46-
skipInterceptor.set(false);
4740
}
41+
} catch (SQLException exception) {
42+
sqlInterceptor.afterHandler(sql, null, exception);
43+
} finally {
44+
// 重置拦截器状态
45+
skipInterceptor.set(false);
4846
}
4947
return SQLInterceptState.unIntercept(sql);
5048
}

0 commit comments

Comments
 (0)