From 31b9b4cb19fab4f478ff8762ce5742fa1736b1cb Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期二, 06 八月 2024 15:41:10 +0800
Subject: [PATCH] 新增余料管理
---
north-glass-erp/src/main/java/com/example/erp/exception/GlobalExceptionHandle.java | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/north-glass-erp/src/main/java/com/example/erp/exception/GlobalExceptionHandle.java b/north-glass-erp/src/main/java/com/example/erp/exception/GlobalExceptionHandle.java
index b7227dc..cba151d 100644
--- a/north-glass-erp/src/main/java/com/example/erp/exception/GlobalExceptionHandle.java
+++ b/north-glass-erp/src/main/java/com/example/erp/exception/GlobalExceptionHandle.java
@@ -9,6 +9,8 @@
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
+import java.util.Arrays;
+
@ControllerAdvice
public class GlobalExceptionHandle {
/**
@@ -20,10 +22,11 @@
return Result.error(se.getCode(),se.getMessage());
}
+ // 鎷︽埅锛氭棤鏉冮檺寮傚父
@ExceptionHandler(NotPermissionException.class)
@ResponseBody
public Result handlerException(NotPermissionException e) {
- return Result.error(Constants.Code_401,"This user has no permission to access this resource");
+ return Result.error(Constants.Code_401,e.getPermission());
}
// 鎷︽埅锛氭湭鐧诲綍寮傚父
--
Gitblit v1.8.0