From 5205800f2ec23859d3568f19ee7d312998a56f2a Mon Sep 17 00:00:00 2001 From: laker <935009066@qq.com> Date: Fri, 24 Sep 2021 14:22:38 +0800 Subject: [PATCH] =?UTF-8?q?(update)[=E6=95=B4=E4=BD=93](nginxui=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=96=B0=E5=A2=9E)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/handler/GlobalExceptionHandler.java | 7 ++----- .../admin/module/sys/controller/NginxController.java | 6 ++++++ web/admin/view/system/nginx.html | 10 +++++----- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/laker/admin/framework/handler/GlobalExceptionHandler.java b/src/main/java/com/laker/admin/framework/handler/GlobalExceptionHandler.java index 3fba69a..76b58d2 100644 --- a/src/main/java/com/laker/admin/framework/handler/GlobalExceptionHandler.java +++ b/src/main/java/com/laker/admin/framework/handler/GlobalExceptionHandler.java @@ -24,10 +24,8 @@ import org.springframework.web.method.annotation.MethodArgumentTypeMismatchExcep import org.springframework.web.multipart.MaxUploadSizeExceededException; import org.springframework.web.servlet.NoHandlerFoundException; -import javax.servlet.http.HttpServletResponse; import javax.validation.ConstraintViolationException; import javax.xml.bind.ValidationException; -import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -139,9 +137,8 @@ public class GlobalExceptionHandler { } @ExceptionHandler(SaTokenException.class) - public Response handleMaxSizeException(SaTokenException e, HttpServletResponse response) throws IOException { - log.info(HttpServletRequestUtil.getAllRequestInfo()); - log.error(e.getMessage()); + public Response handleMaxSizeException(SaTokenException e) { + log.error("uriļ¼š{}, httpMethod:{}, errMsg:{}", HttpServletRequestUtil.getRequestURI(), HttpServletRequestUtil.getRequest().getMethod(), e.getMessage()); return Response.error("403", e.getMessage()); } diff --git a/src/main/java/com/laker/admin/module/sys/controller/NginxController.java b/src/main/java/com/laker/admin/module/sys/controller/NginxController.java index 7e36cef..7d6400c 100644 --- a/src/main/java/com/laker/admin/module/sys/controller/NginxController.java +++ b/src/main/java/com/laker/admin/module/sys/controller/NginxController.java @@ -1,5 +1,6 @@ package com.laker.admin.module.sys.controller; +import cn.dev33.satoken.annotation.SaCheckPermission; import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.RuntimeUtil; @@ -50,6 +51,7 @@ public class NginxController { } @PostMapping + @SaCheckPermission("nginx.update") public Response update(@RequestBody NginxQo nginxQo) { if (StrUtil.isBlank(nginxQo.getPath())) { nginxQo.setPath(lakerConfig.getNginx().getConfPath()); @@ -60,6 +62,7 @@ public class NginxController { } @PostMapping("/check") + @SaCheckPermission("nginx.check") public Response check(@RequestBody NginxQo nginxQo) { if (StrUtil.isBlank(nginxQo.getPath())) { nginxQo.setPath(lakerConfig.getNginx().getConfPath()); @@ -69,6 +72,7 @@ public class NginxController { } @PostMapping("/reload") + @SaCheckPermission("nginx.reload") public Response reload(@RequestBody NginxQo nginxQo) { if (StrUtil.isBlank(nginxQo.getPath())) { nginxQo.setPath(lakerConfig.getNginx().getConfPath()); @@ -78,6 +82,7 @@ public class NginxController { } @PostMapping("/start") + @SaCheckPermission("nginx.start") public Response start(@RequestBody NginxQo nginxQo) { if (StrUtil.isBlank(nginxQo.getPath())) { nginxQo.setPath(lakerConfig.getNginx().getConfPath()); @@ -87,6 +92,7 @@ public class NginxController { } @PostMapping("/stop") + @SaCheckPermission("nginx.stop") public Response stop() { String res = RuntimeUtil.execForStr("nginx -s quit"); return Response.ok(res); diff --git a/web/admin/view/system/nginx.html b/web/admin/view/system/nginx.html index 54aba16..9841fae 100644 --- a/web/admin/view/system/nginx.html +++ b/web/admin/view/system/nginx.html @@ -79,7 +79,7 @@ { icon: 2, time: 2000, - area: ['220px', '70px'] + area: ['250px', '70px'] } ); } @@ -107,7 +107,7 @@ { icon: 2, time: 2000, - area: ['220px', '70px'] + area: ['250px', '70px'] } ); } @@ -134,7 +134,7 @@ { icon: 2, time: 2000, - area: ['220px', '70px'] + area: ['250px', '70px'] } ); } @@ -162,7 +162,7 @@ { icon: 2, time: 2000, - area: ['220px', '70px'] + area: ['250px', '70px'] } ); } @@ -193,7 +193,7 @@ { icon: 2, time: 2000, - area: ['220px', '70px'] + area: ['250px', '70px'] } ); } -- GitLab