zhangnaisong
2024-03-04 55d5a7502627bf794adbbdeb041e0274a99e304c
ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java
@@ -66,8 +66,14 @@
    @Autowired
    private RedisCache redisCache;
    @Value("${uav.enabled}")
    private Boolean uavEnabled;
    @PostConstruct
    public void created() {
        if(!uavEnabled){//无人机加入开关
            return;
        }
        getUavConfig();
        this.login();
@@ -76,14 +82,14 @@
    }
    private void getUavConfig() {
        this.host = ConfigUtils.getConfigValue("uav_host");
        /*this.host = ConfigUtils.getConfigValue("uav_host");
        this.username = ConfigUtils.getConfigValue("uav_username");
        this.password = ConfigUtils.getConfigValue("uav_password");
        this.salt = ConfigUtils.getConfigValue("uav_salt");
        /*this.host = "http://112.98.126.2:6100/";
        this.salt = ConfigUtils.getConfigValue("uav_salt");*/
        this.host = "http://112.98.126.2:6100/";
        this.username = "znstest";
        this.password = "znstest";
        this.salt = "0123456789012345";*/
        this.salt = "0123456789012345";
        if (StringUtils.isEmpty(this.host) || StringUtils.isEmpty(this.username) || StringUtils.isEmpty(this.password) || StringUtils.isEmpty(this.salt)) {
            throw new RuntimeException("无人机参数配置缺失:");
        }