项目自动打包完成打开IE浏览器

master
ck 5 years ago
parent a709715328
commit 168785a8cc

@ -0,0 +1,33 @@
package com.jingcheng.cms.conf;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
@Component
public class MyCommandRunner implements CommandLineRunner {
private static Logger logger = LoggerFactory.getLogger(MyCommandRunner.class);
@Value("${cmd.loginurl}")
private String loginUrl;
@Value("${cmd.command}")
private String command;
@Override
public void run(String... args) throws Exception {
String cmd = command +" "+ loginUrl;
Runtime run = Runtime.getRuntime();
try{
run.exec(cmd);
logger.debug("启动浏览器打开项目成功");
}catch (Exception e){
e.printStackTrace();
logger.error(e.getMessage());
}
}
}

@ -77,4 +77,7 @@ oss:
accessKey: bE00QP1WdBlxk7vFGdIA3rxZikP7HY accessKey: bE00QP1WdBlxk7vFGdIA3rxZikP7HY
maxFileSize: 102400KB maxFileSize: 102400KB
maxRequestSize: 1024000KB maxRequestSize: 1024000KB
filedir: cases/ filedir: cases/
cmd:
loginurl: http://localhost:8888
command: cmd /c start iexplore
Loading…
Cancel
Save