From 0017dec8baea29062ccac94a15248a61f7bdf77d Mon Sep 17 00:00:00 2001 From: zhangjianrock@163.com <zhangjianrock@163.com> Date: 星期一, 29 一月 2024 16:15:56 +0800 Subject: [PATCH] 无人机读取配置文件 --- ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java b/ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java index 1f91fd8..2a009f9 100644 --- a/ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java +++ b/ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java @@ -60,6 +60,8 @@ private void getUavConfig() { this.host = ConfigUtils.getConfigValue("uav_host"); + this.username = ConfigUtils.getConfigValue("uav_username"); + this.password = ConfigUtils.getConfigValue("uav_password"); this.salt = ConfigUtils.getConfigValue("uav_salt"); if (StringUtils.isEmpty(this.host) || StringUtils.isEmpty(this.username) || StringUtils.isEmpty(this.password) || StringUtils.isEmpty(this.salt)) { throw new RuntimeException("鏃犱汉鏈哄弬鏁伴厤缃己澶�:"); @@ -128,7 +130,7 @@ //uavClient.GET("logout", null, "{}"); String res = uavClient.POST(this.host+"login", null, body); Map resMap = om.readValue(res, Map.class); - if (resMap != null) { + if (resMap != null&& resMap.get("data") instanceof Map) { redisCache.setCacheMap("uav:uavUser", (Map) resMap.get("data")); } } catch (ForestRuntimeException e) { -- Gitblit v1.9.3