From 49034a174da199c56fa132973b99a6b06cd5b4a4 Mon Sep 17 00:00:00 2001
From: heheng <heheng@123456>
Date: Mon, 23 Dec 2024 17:05:29 +0800
Subject: [PATCH] 修改sql
---
assess-framework/src/main/java/com/gkhy/assess/framework/exception/GlobalExceptionHandler.java | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/assess-framework/src/main/java/com/gkhy/assess/framework/exception/GlobalExceptionHandler.java b/assess-framework/src/main/java/com/gkhy/assess/framework/exception/GlobalExceptionHandler.java
index 6d6083b..a92ec25 100644
--- a/assess-framework/src/main/java/com/gkhy/assess/framework/exception/GlobalExceptionHandler.java
+++ b/assess-framework/src/main/java/com/gkhy/assess/framework/exception/GlobalExceptionHandler.java
@@ -4,6 +4,7 @@
import com.gkhy.assess.common.exception.ApiException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.authz.UnauthorizedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -79,6 +80,16 @@
/**
* 拦截未知的运行时异常
*/
+ @ExceptionHandler(UnauthorizedException.class)
+ public CommonResult handleUnauthorizedException(RuntimeException ex, HttpServletRequest request)
+ {
+ writeExceptionLogFile(ex);
+ return CommonResult.failed("权限不足,无权操作!");
+ }
+
+ /**
+ * 拦截未知的运行时异常
+ */
@ExceptionHandler(RuntimeException.class)
public CommonResult handleRuntimeException(RuntimeException ex, HttpServletRequest request)
{
@@ -105,7 +116,7 @@
if (request!=null) {
url=request.getRequestURI();
}
- log.error("error={}",ex);
+ log.error("error:",ex);
log.error(ex.getMessage()+",url={}",url);
}
}
--
Gitblit v1.9.2