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

.

上级 66efc6b5
......@@ -3,6 +3,8 @@ package com.priusis.controller;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.priusis.lib.R;
import com.priusis.util.SysConfigUtil;
import lombok.SneakyThrows;
......@@ -31,8 +33,8 @@ public class RemoteControlController {
* 前端定时任务查询远程控制请求,不为空则表示有请求,展示确认弹窗
*/
@GetMapping(value = "get_control_request")
public R<String> getControlRequest() throws IOException {
return R.success(SysConfigUtil.getProperty("control.request"));
public R<JSONObject> getControlRequest() throws IOException {
return R.success(JSONUtil.parseObj(SysConfigUtil.getProperty("control.request")));
}
/**
......@@ -43,11 +45,13 @@ public class RemoteControlController {
String requestParams = SysConfigUtil.getProperty("control.request");
if (StrUtil.isBlank(requestParams)) return R.error("无远程请求");
SysConfigUtil.saveProperty("control.request", null);
// 开启VNC Server
JSONObject obj = JSONUtil.parseObj(requestParams);
String id = obj.getStr("id");
// 开启VNC Server todo 设置ID
Runtime.getRuntime().exec("cmd /c C:\\Program Files\\RealVNC\\VNC Server\\vncserver.exe");
// todo 从参数里取出控制的时间,单位分钟
int minute = 1;
// 从参数里取出控制的时间,单位分钟
int minute = obj.getInt("time");
// 定时任务,指定分钟后执行一次
Timer timer = new Timer();
timer.schedule(new TimerTask() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论