optim cron check
@@ -7,11 +7,9 @@ import cn.jiangzeyin.common.validator.ValidatorItem;
import io.jpom.common.BaseServerController;
import io.jpom.common.forward.NodeForward;
import io.jpom.common.forward.NodeUrl;
-import io.jpom.common.interceptor.PermissionInterceptor;
import io.jpom.model.PageResultDto;
import io.jpom.model.data.NodeModel;
import io.jpom.model.node.ScriptCacheModel;
-import io.jpom.model.data.UserModel;
import io.jpom.permission.NodeDataPermission;
import io.jpom.permission.SystemPermission;
import io.jpom.plugin.ClassFeature;
@@ -21,7 +19,6 @@ import io.jpom.service.node.script.NodeScriptExecuteLogServer;
import io.jpom.service.node.script.NodeScriptServer;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
-import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@@ -88,10 +85,7 @@ public class NodeScriptController extends BaseServerController {
@Feature(method = MethodFeature.EDIT)
public String save(String autoExecCron) {
NodeModel node = getNode();
- if (StrUtil.isNotEmpty(autoExecCron)) {
- UserModel user = getUser();
- Assert.state(!user.isDemoUser(), PermissionInterceptor.DEMO_TIP);
- }
+ this.checkCron(autoExecCron);
JsonMessage<Object> request = NodeForward.request(node, getRequest(), NodeUrl.Script_Save);
if (request.getCode() == HttpStatus.OK.value()) {
nodeScriptServer.syncNode(node);
