提交 c4248271 authored 作者: chenxinchang's avatar chenxinchang

--no commit message

上级 5679fb86
......@@ -4,7 +4,6 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@EnableEurekaServer
@SpringBootApplication
public class Application {
......
package com.zrqx.eureka;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class RunShell {
private static String CHMOD777 = "chmod 777 ";
/*private static String PATH = "/root/test";
public static String SYSUSER = PATH + "/sys.sh";*/
public static String into(String shpath) {
StringBuffer sb = new StringBuffer();
try {
Process ps = Runtime.getRuntime().exec(shpath);
int status = ps.waitFor();
if(status == 1){
sb.append("权限不够 自动赋权重新执行" + CHMOD777);
Runtime.getRuntime().exec(CHMOD777+shpath);
ps = Runtime.getRuntime().exec(shpath);
}
if(status == 2){
sb.append("没有这样的文件或目录");
}
sb.append(" 执行结果:").append(status).append("\n");
BufferedReader br = new BufferedReader(new InputStreamReader(ps.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
sb.append(line).append("\n");
}
} catch (Exception e) {
sb.append(shpath).append(" 执行异常:"+e.getMessage()).append("\n");
e.printStackTrace();
}
return sb.toString();
}
}
\ No newline at end of file
package com.zrqx.eureka.config;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().ignoringAntMatchers("/eureka/**");
super.configure(http);
}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论