Эх сурвалжийг харах

请求过滤排除控制接口

andy 1 жил өмнө
parent
commit
4bf8a91c2c

+ 1 - 1
src/main/java/com/scbfkj/uni/api/LogAop.java

@@ -57,7 +57,7 @@ public class LogAop {
                 if (arg instanceof Map map) {
 //                    查找serviceid
                     Optional serviceid = DataAliasGetUtil.getValue("serviceid", map);
-                    if (serviceid.isPresent()) {
+                    if (serviceid.isPresent() && uri.startsWith("/openApi")) {
 //                        查找状态
                         List<Map<String, Object>> mapList = DataBase.query(Config.getCenterConnectionStr(), """
                                 select runstate from servicestate where serviceid=? and containercode = ?""", serviceid.get(), Config.getContainerCode());

+ 1 - 1
src/main/java/com/scbfkj/uni/service/DataProcessService.java

@@ -44,7 +44,7 @@ public class DataProcessService {
             List<Map<String, Object>> serviceState = DataBase.query(Config.getCenterConnectionStr(), """
                     select 1 as runstate
                     from servicestate
-                    where serviceid =? and runstate = '1'""", serviceId);
+                    where serviceid =? and runstate = '1' and containercode=?""", serviceId, Config.getContainerCode());
             if (serviceState.isEmpty()) {
                 throw new RuntimeException("服务没有运行");
             }