Browse Source

添加晋能数据权限过滤

shilin 1 year ago
parent
commit
e72ed48d1d

+ 19 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/controller/health/HealthController.java

@@ -995,4 +995,23 @@ public class HealthController {
         return ajax;
 
     }
+
+
+    /**
+     * 登录
+     * @return
+     */
+    @PostMapping("/login")
+    @ResponseBody
+    @ApiOperation(value = "登录", notes = "登录")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "token", value = "令牌", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult login(String token, String userId) throws Exception {
+
+        AjaxResult ajax = healthMainService.login(token,userId);
+
+        return ajax;
+
+    }
 }

+ 9 - 1
web/consumer-hb/src/main/java/com/gyee/consumer/fallback/health/HealthServiceFallbackFactory.java

@@ -6,7 +6,6 @@ import com.gyee.consumer.model.Healthsystemsub;
 import com.gyee.consumer.model.Tablepar;
 import com.gyee.consumer.service.health.HealthService;
 import feign.hystrix.FallbackFactory;
-import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 
 public class HealthServiceFallbackFactory implements FallbackFactory<HealthService> {
@@ -368,6 +367,15 @@ public class HealthServiceFallbackFactory implements FallbackFactory<HealthServi
                 return AjaxResult.error(throwable.getMessage());
             }
 
+
+            @Override
+            public AjaxResult login(@RequestParam("token") String token,@RequestParam("userId")  String userId) throws Exception{
+                return AjaxResult.error(throwable.getMessage());
+            }
+            @Override
+            public AjaxResult logout(@RequestParam("token") String token,@RequestParam("userId")  String userId) throws Exception{
+                return AjaxResult.error(throwable.getMessage());
+            }
         };
     }
 }

+ 4 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/service/health/HealthService.java

@@ -281,4 +281,8 @@ public interface HealthService {
     @GetMapping("/report/getEarlyWarningMainListByWpId")
     public AjaxResult getEarlyWarningMainListByWpId(@RequestParam("wpId") String wpId,@RequestParam("recorddate")  String recorddate) throws Exception;
 
+    @PostMapping("/auth/login")
+    public AjaxResult login(@RequestParam("token") String token,@RequestParam("userId")  String userId) throws Exception;
+    @PostMapping("/auth/logout")
+    public AjaxResult logout(@RequestParam("token") String token,@RequestParam("userId")  String userId) throws Exception;
 }

+ 2 - 2
web/consumer-hb/src/main/resources/application-jn.properties

@@ -3,8 +3,8 @@ server.port=8170
 
 #\u670D\u52A1\u540D\u79F0
 spring.application.name=consumer-hb
-spring.cloud.nacos.discovery.server-addr=127.0.0.1:8870
-#spring.cloud.nacos.discovery.server-addr=10.81.3.155:8848
+#spring.cloud.nacos.discovery.server-addr=127.0.0.1:8870
+spring.cloud.nacos.discovery.server-addr=10.81.3.155:8848
 
 
 #nacos\u7684\u7528\u6237\u540D\u548C\u5BC6\u7801

+ 12 - 12
web/consumer-hb/src/main/resources/application-jn.yml

@@ -102,19 +102,19 @@ feign:
         read-timeout: 60000
         connect-timeout: 60000
 provider:
-#  monitorurl: http://10.81.3.155:8171/
-#  healthurl: http://10.81.3.155:8172/
-#  analysisurl: http://10.81.3.155:8172/
-#  adminurl: http://10.81.3.155:8171/
-#  alarmurl: http://10.81.3.155:8176/
-#  peranalyurl: http://10.81.3.155:8171/
+  monitorurl: http://10.81.3.155:8171/
+  healthurl: http://10.81.3.155:8172/
+  analysisurl: http://10.81.3.155:8172/
+  adminurl: http://10.81.3.155:8171/
+  alarmurl: http://10.81.3.155:8176/
+  peranalyurl: http://10.81.3.155:8171/
 
-  monitorurl: http://127.0.0.1:8171/
-  healthurl: http://127.0.0.1:8172/
-  analysisurl: http://127.0.0.1:8172/
-  adminurl: http://127.0.0.1:8171/
-  alarmurl: http://127.0.0.1:8176/
-  peranalyurl: http://127.0.0.1:8171/
+#  monitorurl: http://127.0.0.1:8171/
+#  healthurl: http://127.0.0.1:8172/
+#  analysisurl: http://127.0.0.1:8172/
+#  adminurl: http://127.0.0.1:8171/
+#  alarmurl: http://127.0.0.1:8176/
+#  peranalyurl: http://127.0.0.1:8171/
 management:
   endpoints:
     jmx: