From d503bba7dd069f49570dd7184050df9b5096537a Mon Sep 17 00:00:00 2001 From: huangweixiong Date: Wed, 1 Jun 2022 09:53:17 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E8=A7=86=E9=A2=91=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=EF=BC=8C=E5=88=9B=E5=9F=8E=E5=90=88=E5=B9=B6=E3=80=91=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/monitor/service/MonitorService.java | 16 ++++++++++++++-- .../src/main/resources/application-dev.yml | 1 + .../src/main/resources/application-hwx.yml | 1 + .../src/main/resources/application-prod.yml | 1 + renren-admin/src/main/resources/application.yml | 2 +- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/monitor/service/MonitorService.java b/renren-admin/src/main/java/io/renren/modules/monitor/service/MonitorService.java index b17de2b3..52f91f2a 100644 --- a/renren-admin/src/main/java/io/renren/modules/monitor/service/MonitorService.java +++ b/renren-admin/src/main/java/io/renren/modules/monitor/service/MonitorService.java @@ -66,9 +66,9 @@ public class MonitorService { @Autowired private BoothMapper boothMapper; - @Value("${hwx.file.work-path}") + @Value("${resource.path}") private String fileDir; - @Value("${hwx.file.pic-host}") + @Value("${resource.pic-host}") private String picHost; @Value("iOgQotfgfyLvhj6WgfDTpq7F") @@ -88,6 +88,18 @@ public class MonitorService { @PostConstruct public String init(){ + try { + return monitorLogin(); + }catch (Exception e){ + log.warn("摄像头登录异常,跳过", e); + } + + return null; + + } + + public String monitorLogin(){ + String loginUrl = monitorDomain + "/videoService/accounts/authorize"; HashMap loginParam = new HashMap<>(); loginParam.put("userName", userName); diff --git a/renren-admin/src/main/resources/application-dev.yml b/renren-admin/src/main/resources/application-dev.yml index 186c5a4b..b7b77700 100644 --- a/renren-admin/src/main/resources/application-dev.yml +++ b/renren-admin/src/main/resources/application-dev.yml @@ -53,6 +53,7 @@ spring: #上传的静态资源配置 resource: root_url: 15.2.21.238 + pic-host: http://${resource.root_url}:${server.port}${server.servlet.context-path} path: /home/yth/files/ devModelFilePath: /home/yth/files/devModelFile # 大数据部门相关配置 diff --git a/renren-admin/src/main/resources/application-hwx.yml b/renren-admin/src/main/resources/application-hwx.yml index c6b8b9a3..6ad9e950 100644 --- a/renren-admin/src/main/resources/application-hwx.yml +++ b/renren-admin/src/main/resources/application-hwx.yml @@ -37,6 +37,7 @@ spring: #上传的静态资源配置 resource: root_url: 15.2.21.238 + pic-host: http://${resource.root_url}:${server.port}${server.servlet.context-path} path: /data/services/nengli/files/ devModelFilePath: /data/services/nengli/files/devModelFile # 大数据部门相关配置 diff --git a/renren-admin/src/main/resources/application-prod.yml b/renren-admin/src/main/resources/application-prod.yml index 949faba0..b9733fbe 100644 --- a/renren-admin/src/main/resources/application-prod.yml +++ b/renren-admin/src/main/resources/application-prod.yml @@ -37,6 +37,7 @@ spring: #上传的静态资源配置 resource: root_url: 15.72.183.90 + pic-host: http://${resource.root_url}:${server.port}${server.servlet.context-path} path: /data/services/nengli/files/ devModelFilePath: /data/services/nengli/files/devModelFile # 大数据部门相关配置 diff --git a/renren-admin/src/main/resources/application.yml b/renren-admin/src/main/resources/application.yml index 38b75291..60124664 100644 --- a/renren-admin/src/main/resources/application.yml +++ b/renren-admin/src/main/resources/application.yml @@ -26,7 +26,7 @@ server: spring: # 环境 dev|test|prod|show profiles: - active: dev + active: hwx messages: encoding: UTF-8 basename: i18n/messages