Commit 82f148e5 by fanjiaxin

异常日志打印简化

parent 8e339ae5
Pipeline #71956 passed with stages
in 1 minute 7 seconds
...@@ -17,7 +17,7 @@ public interface HttpStatusConstant { ...@@ -17,7 +17,7 @@ public interface HttpStatusConstant {
/** /**
* 未绑定推客 * 未绑定推客
*/ */
int UNAUTHSHARER = 40101; int NO_BIND_SHARER = 40101;
/** /**
* 失败标记 * 失败标记
......
...@@ -25,8 +25,6 @@ public class GlobalExceptionHandler { ...@@ -25,8 +25,6 @@ public class GlobalExceptionHandler {
*/ */
@ExceptionHandler(NoAuthException.class) @ExceptionHandler(NoAuthException.class)
public Result<Void> handleNoAuthException(NoAuthException e, HttpServletRequest request) { public Result<Void> handleNoAuthException(NoAuthException e, HttpServletRequest request) {
String requestURI = request.getRequestURI();
log.error("请求地址'{}',认证失败'{}',无法访问系统资源", requestURI, e.getMessage());
return Result.fail(HttpStatusConstant.UNAUTHORIZED, "认证失败,无法访问系统资源"); return Result.fail(HttpStatusConstant.UNAUTHORIZED, "认证失败,无法访问系统资源");
} }
...@@ -35,9 +33,7 @@ public class GlobalExceptionHandler { ...@@ -35,9 +33,7 @@ public class GlobalExceptionHandler {
*/ */
@ExceptionHandler(NoBindSharerException.class) @ExceptionHandler(NoBindSharerException.class)
public Result<Void> handleNoBindSharerException(NoBindSharerException e, HttpServletRequest request) { public Result<Void> handleNoBindSharerException(NoBindSharerException e, HttpServletRequest request) {
String requestURI = request.getRequestURI(); return Result.fail(HttpStatusConstant.NO_BIND_SHARER, "未授权推客");
log.error("请求地址'{}',认证失败'{}',无法访问系统资源", requestURI, e.getMessage());
return Result.fail(HttpStatusConstant.UNAUTHSHARER, "未授权推客");
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment