@Component public class ExecuteScriptDirective extends AbstractTemplateDirective
参数列表
command
:命令【sync.bat,sync.sh,backupdb.bat,backupdb.sh】
parameters
:参数数组
打印执行结果
使用示例
<@tools.executeScript command='backupdb.bat'/>
<script> $.getJSON('${site.dynamicPath}api/directive/tools/executeScript?command=backupdb.bat&appToken=接口访问授权Token', function(data){ console.log(data.id); }); </script>
限定符和类型 | 字段和说明 |
---|---|
protected ScriptComponent |
scriptComponent |
ADVANCED, AUTH_TOKEN, AUTH_USER_ID, siteComponent
log
构造器和说明 |
---|
ExecuteScriptDirective() |
限定符和类型 | 方法和说明 |
---|---|
void |
execute(RenderHandler handler) |
boolean |
needAppToken() |
execute, expose, getAdvanced, getApp, getSite, getUserId, needUserToken, supportAdvanced
execute, getName, getNamespace, getShortName, httpEnabled, setName, setNamespace, setShortName
protected ScriptComponent scriptComponent
public void execute(RenderHandler handler) throws java.io.IOException, freemarker.template.TemplateException
java.io.IOException
freemarker.template.TemplateException
public boolean needAppToken()
needAppToken
在类中 AbstractTemplateDirective