zhangjianrock@163.com
2024-01-29 0017dec8baea29062ccac94a15248a61f7bdf77d
ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java
@@ -80,7 +80,7 @@
            e.printStackTrace();
        }
        //执行method
        this.getToken();//获取token验证,验证token有效性
       // this.getToken();//获取token验证,验证token有效性
        try {
            String token = this.getToken();
            res = (String) requestMethod.invoke(this.uavClient, this.host + url, token, data);
@@ -105,6 +105,7 @@
        //验证token有效性
        try {
            String res = uavClient.GET(this.host+"manage/api/v1/devices", token, "{}");
            res+="";
            //System.out.println(res);
        } catch (ForestNetworkException fe) {
            if (fe.getStatusCode() == 401) {//token失效,重新登录
@@ -129,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) {