From 38f7a5cae3d0daadd2cbc7e18756b0c98c978c26 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期二, 28 五月 2024 11:26:21 +0800
Subject: [PATCH] 修改订单导出模板,以及添加行放到最后一行。 添加计算方式类型

---
 north-glass-erp/src/main/java/com/example/erp/exception/GlobalExceptionHandle.java |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 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 e353e73..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
@@ -1,9 +1,15 @@
 package com.example.erp.exception;
 
+import cn.dev33.satoken.exception.NotLoginException;
+import cn.dev33.satoken.exception.NotPermissionException;
+import cn.dev33.satoken.util.SaResult;
+import com.example.erp.common.Constants;
 import com.example.erp.common.Result;
 import org.springframework.web.bind.annotation.ControllerAdvice;
 import org.springframework.web.bind.annotation.ExceptionHandler;
 import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.Arrays;
 
 @ControllerAdvice
 public class GlobalExceptionHandle {
@@ -15,4 +21,19 @@
     public Result handle(ServiceException se){
         return Result.error(se.getCode(),se.getMessage());
     }
+
+    // 鎷︽埅锛氭棤鏉冮檺寮傚父
+    @ExceptionHandler(NotPermissionException.class)
+    @ResponseBody
+    public Result handlerException(NotPermissionException e) {
+        return Result.error(Constants.Code_401,e.getPermission());
+    }
+
+    // 鎷︽埅锛氭湭鐧诲綍寮傚父
+    @ExceptionHandler(NotLoginException.class)
+    @ResponseBody
+    public Result handlerException(NotLoginException e) {
+        // 杩斿洖缁欏墠绔�
+        return Result.error(Constants.Code_402,"Please login user");
+    }
 }

--
Gitblit v1.8.0