提交 b8363840 authored 作者: yangli's avatar yangli

.

上级 6d6cace6
......@@ -340,7 +340,17 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
// 存储rpc下发的数据
try {
if ("power".equals(mqttRpcDataMessage.getMethod())) {
Integer type = JSONUtil.parseObj(mqttRpcDataMessage.getParams()).getInt("powerType");
if (type == 0) {
log.info("远程关机!!!");
Runtime.getRuntime().exec("cmd /c shutdown -s");
} else if (type == 1) {
log.info("远程重启!!!");
Runtime.getRuntime().exec("cmd /c shutdown -r");
}
return;
}
if ("remote_control".equals(mqttRpcDataMessage.getMethod())) {// 远程控制请求
log.info("收到远程控制请求!!!");
if (vncServerIsRunning()) {
......@@ -362,6 +372,7 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
return;
}
persistentFileService.flushRpcDataToFile(mqttRpcDataMessage);
} catch (Exception e) {
log.error("Failed to process rpc command persistent : {}", message, e);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论