yq 3 年之前
父节点
当前提交
4a69f00d3a

+ 1 - 1
fiveep-service/src/main/java/com/bizmatics/service/config/ResourcesConfig.java

@@ -43,7 +43,7 @@ public class ResourcesConfig implements WebMvcConfigurer
     public void addInterceptors(InterceptorRegistry registry)
     {
         registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**");
-//        registry.addInterceptor(checkExecuteInterceptor).addPathPatterns("/alarmPower/**","/site/**","/htAnalogData/**");
+        registry.addInterceptor(checkExecuteInterceptor).addPathPatterns("/alarmPower/**","/site/**","/htAnalogData/**");
     }
     /**
      * 跨域配置

+ 6 - 6
fiveep-service/src/main/java/com/bizmatics/service/interceptor/CheckExecuteInterceptor.java

@@ -24,9 +24,9 @@ import java.util.Map;
 @Component
 public class CheckExecuteInterceptor extends HandlerInterceptorAdapter {
 
-    private static final String PATH = "http://localhost:8082";
+    private static final String PATH = "http://iot.usky.cn";
 
-    private static final String CHECK_URL = String.format("%s%s",PATH,"/check");
+    private static final String CHECK_URL = String.format("%s%s",PATH,"/ytapi/admin/Manage/wooGiJavaApi");
 
     private static final String JWT_KEY = "U0JBUElKV1RkV2FuZzkyNjQ1NA==";
 
@@ -38,13 +38,13 @@ public class CheckExecuteInterceptor extends HandlerInterceptorAdapter {
         map.put("loginName","wj");
         String token = createToken(map);
         String wj = String.format("%s?token=%s", CHECK_URL, token);
-        boolean result;
+        Integer result;
         try {
-            result = Boolean.parseBoolean(HttpUtils.get(wj, null));
+            result = Integer.parseInt(HttpUtils.get(wj, null));
         }catch (Exception e){
-            result =  false;
+            result =  0;
         }
-        if (!result){
+        if (result != 1){
             ApiResult<Object> error = ApiResult.error(SystemErrorCode.SYS_SYSTEM_ERROR.getCode(), "系统异常请联系管理员");
             ServletUtils.renderString(response, JsonUtils.toJson(error));
             return false;