Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
master-4.0
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
master-4.0
Commits
c4248271
提交
c4248271
authored
1月 22, 2019
作者:
chenxinchang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
5679fb86
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
16 行增加
和
39 行删除
+16
-39
Application.java
...rqx.eureka/src/main/java/com/zrqx/eureka/Application.java
+0
-1
RunShell.java
com.zrqx.eureka/src/main/java/com/zrqx/eureka/RunShell.java
+0
-38
WebSecurityConfig.java
...c/main/java/com/zrqx/eureka/config/WebSecurityConfig.java
+16
-0
没有找到文件。
com.zrqx.eureka/src/main/java/com/zrqx/eureka/Application.java
浏览文件 @
c4248271
...
...
@@ -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
{
...
...
com.zrqx.eureka/src/main/java/com/zrqx/eureka/RunShell.java
deleted
100644 → 0
浏览文件 @
5679fb86
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
com.zrqx.eureka/src/main/java/com/zrqx/eureka/config/WebSecurityConfig.java
0 → 100644
浏览文件 @
c4248271
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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论