‘liusuyi’
2024-01-13 43f46c3801b0aa8544a1703e4f1a27ecc8db22b8
ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java
@@ -83,9 +83,9 @@
            String token = this.getToken();
            res = (String) requestMethod.invoke(this.uavClient, this.host + url, token, data);
        } catch (IllegalAccessException e) {
            System.out.println("doUavRequest 访问失败" + e.getMessage());
            log.error("doUavRequest 访问失败" + e.getMessage());
        } catch (InvocationTargetException e) {
            System.out.println("doUavRequest 执行失败" + e.getMessage());
            log.error("doUavRequest 执行失败" + e.getMessage());
            e.printStackTrace();
        }
@@ -103,7 +103,7 @@
        //验证token有效性
        try {
            String res = uavClient.GET(this.host+"manage/api/v1/devices", token, "{}");
            System.out.println(res);
            //System.out.println(res);
        } catch (ForestNetworkException fe) {
            if (fe.getStatusCode() == 401) {//token失效,重新登录
                this.login();
@@ -122,7 +122,7 @@
        log.debug("登录无人机外部接口");
        String codedPassword = this.Encrypt(password, salt);
        String body = "{\"username\":\"" + username + "\",\"password\":\"" + codedPassword + "\"}";
        System.out.println("body:" + body);
        log.debug("body:" + body);
        try {
            //uavClient.GET("logout", null, "{}");
            String res = uavClient.POST(this.host+"login", null, body);