Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lakernote
EasyAdmin
提交
5205800f
E
EasyAdmin
项目概览
lakernote
/
EasyAdmin
9 个月 前同步成功
通知
14
Star
3
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
EasyAdmin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5205800f
编写于
9月 24, 2021
作者:
lakernote
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
(update)[整体](nginxui功能新增)
上级
80b9d289
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
10 deletion
+13
-10
src/main/java/com/laker/admin/framework/handler/GlobalExceptionHandler.java
...laker/admin/framework/handler/GlobalExceptionHandler.java
+2
-5
src/main/java/com/laker/admin/module/sys/controller/NginxController.java
...om/laker/admin/module/sys/controller/NginxController.java
+6
-0
web/admin/view/system/nginx.html
web/admin/view/system/nginx.html
+5
-5
未找到文件。
src/main/java/com/laker/admin/framework/handler/GlobalExceptionHandler.java
浏览文件 @
5205800f
...
@@ -24,10 +24,8 @@ import org.springframework.web.method.annotation.MethodArgumentTypeMismatchExcep
...
@@ -24,10 +24,8 @@ import org.springframework.web.method.annotation.MethodArgumentTypeMismatchExcep
import
org.springframework.web.multipart.MaxUploadSizeExceededException
;
import
org.springframework.web.multipart.MaxUploadSizeExceededException
;
import
org.springframework.web.servlet.NoHandlerFoundException
;
import
org.springframework.web.servlet.NoHandlerFoundException
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.ConstraintViolationException
;
import
javax.validation.ConstraintViolationException
;
import
javax.xml.bind.ValidationException
;
import
javax.xml.bind.ValidationException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -139,9 +137,8 @@ public class GlobalExceptionHandler {
...
@@ -139,9 +137,8 @@ public class GlobalExceptionHandler {
}
}
@ExceptionHandler
(
SaTokenException
.
class
)
@ExceptionHandler
(
SaTokenException
.
class
)
public
Response
handleMaxSizeException
(
SaTokenException
e
,
HttpServletResponse
response
)
throws
IOException
{
public
Response
handleMaxSizeException
(
SaTokenException
e
)
{
log
.
info
(
HttpServletRequestUtil
.
getAllRequestInfo
());
log
.
error
(
"uri:{}, httpMethod:{}, errMsg:{}"
,
HttpServletRequestUtil
.
getRequestURI
(),
HttpServletRequestUtil
.
getRequest
().
getMethod
(),
e
.
getMessage
());
log
.
error
(
e
.
getMessage
());
return
Response
.
error
(
"403"
,
e
.
getMessage
());
return
Response
.
error
(
"403"
,
e
.
getMessage
());
}
}
...
...
src/main/java/com/laker/admin/module/sys/controller/NginxController.java
浏览文件 @
5205800f
package
com.laker.admin.module.sys.controller
;
package
com.laker.admin.module.sys.controller
;
import
cn.dev33.satoken.annotation.SaCheckPermission
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.util.RuntimeUtil
;
import
cn.hutool.core.util.RuntimeUtil
;
...
@@ -50,6 +51,7 @@ public class NginxController {
...
@@ -50,6 +51,7 @@ public class NginxController {
}
}
@PostMapping
@PostMapping
@SaCheckPermission
(
"nginx.update"
)
public
Response
update
(
@RequestBody
NginxQo
nginxQo
)
{
public
Response
update
(
@RequestBody
NginxQo
nginxQo
)
{
if
(
StrUtil
.
isBlank
(
nginxQo
.
getPath
()))
{
if
(
StrUtil
.
isBlank
(
nginxQo
.
getPath
()))
{
nginxQo
.
setPath
(
lakerConfig
.
getNginx
().
getConfPath
());
nginxQo
.
setPath
(
lakerConfig
.
getNginx
().
getConfPath
());
...
@@ -60,6 +62,7 @@ public class NginxController {
...
@@ -60,6 +62,7 @@ public class NginxController {
}
}
@PostMapping
(
"/check"
)
@PostMapping
(
"/check"
)
@SaCheckPermission
(
"nginx.check"
)
public
Response
check
(
@RequestBody
NginxQo
nginxQo
)
{
public
Response
check
(
@RequestBody
NginxQo
nginxQo
)
{
if
(
StrUtil
.
isBlank
(
nginxQo
.
getPath
()))
{
if
(
StrUtil
.
isBlank
(
nginxQo
.
getPath
()))
{
nginxQo
.
setPath
(
lakerConfig
.
getNginx
().
getConfPath
());
nginxQo
.
setPath
(
lakerConfig
.
getNginx
().
getConfPath
());
...
@@ -69,6 +72,7 @@ public class NginxController {
...
@@ -69,6 +72,7 @@ public class NginxController {
}
}
@PostMapping
(
"/reload"
)
@PostMapping
(
"/reload"
)
@SaCheckPermission
(
"nginx.reload"
)
public
Response
reload
(
@RequestBody
NginxQo
nginxQo
)
{
public
Response
reload
(
@RequestBody
NginxQo
nginxQo
)
{
if
(
StrUtil
.
isBlank
(
nginxQo
.
getPath
()))
{
if
(
StrUtil
.
isBlank
(
nginxQo
.
getPath
()))
{
nginxQo
.
setPath
(
lakerConfig
.
getNginx
().
getConfPath
());
nginxQo
.
setPath
(
lakerConfig
.
getNginx
().
getConfPath
());
...
@@ -78,6 +82,7 @@ public class NginxController {
...
@@ -78,6 +82,7 @@ public class NginxController {
}
}
@PostMapping
(
"/start"
)
@PostMapping
(
"/start"
)
@SaCheckPermission
(
"nginx.start"
)
public
Response
start
(
@RequestBody
NginxQo
nginxQo
)
{
public
Response
start
(
@RequestBody
NginxQo
nginxQo
)
{
if
(
StrUtil
.
isBlank
(
nginxQo
.
getPath
()))
{
if
(
StrUtil
.
isBlank
(
nginxQo
.
getPath
()))
{
nginxQo
.
setPath
(
lakerConfig
.
getNginx
().
getConfPath
());
nginxQo
.
setPath
(
lakerConfig
.
getNginx
().
getConfPath
());
...
@@ -87,6 +92,7 @@ public class NginxController {
...
@@ -87,6 +92,7 @@ public class NginxController {
}
}
@PostMapping
(
"/stop"
)
@PostMapping
(
"/stop"
)
@SaCheckPermission
(
"nginx.stop"
)
public
Response
stop
()
{
public
Response
stop
()
{
String
res
=
RuntimeUtil
.
execForStr
(
"nginx -s quit"
);
String
res
=
RuntimeUtil
.
execForStr
(
"nginx -s quit"
);
return
Response
.
ok
(
res
);
return
Response
.
ok
(
res
);
...
...
web/admin/view/system/nginx.html
浏览文件 @
5205800f
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
{
{
icon
:
2
,
icon
:
2
,
time
:
2000
,
time
:
2000
,
area
:
[
'
2
2
0px
'
,
'
70px
'
]
area
:
[
'
2
5
0px
'
,
'
70px
'
]
}
}
);
);
}
}
...
@@ -107,7 +107,7 @@
...
@@ -107,7 +107,7 @@
{
{
icon
:
2
,
icon
:
2
,
time
:
2000
,
time
:
2000
,
area
:
[
'
2
2
0px
'
,
'
70px
'
]
area
:
[
'
2
5
0px
'
,
'
70px
'
]
}
}
);
);
}
}
...
@@ -134,7 +134,7 @@
...
@@ -134,7 +134,7 @@
{
{
icon
:
2
,
icon
:
2
,
time
:
2000
,
time
:
2000
,
area
:
[
'
2
2
0px
'
,
'
70px
'
]
area
:
[
'
2
5
0px
'
,
'
70px
'
]
}
}
);
);
}
}
...
@@ -162,7 +162,7 @@
...
@@ -162,7 +162,7 @@
{
{
icon
:
2
,
icon
:
2
,
time
:
2000
,
time
:
2000
,
area
:
[
'
2
2
0px
'
,
'
70px
'
]
area
:
[
'
2
5
0px
'
,
'
70px
'
]
}
}
);
);
}
}
...
@@ -193,7 +193,7 @@
...
@@ -193,7 +193,7 @@
{
{
icon
:
2
,
icon
:
2
,
time
:
2000
,
time
:
2000
,
area
:
[
'
2
2
0px
'
,
'
70px
'
]
area
:
[
'
2
5
0px
'
,
'
70px
'
]
}
}
);
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录