From a907f8485c9d8bea82c71be7364c4c511e5e429a Mon Sep 17 00:00:00 2001 From: wzy1024 <395778325@qq.com> Date: 星期二, 04 四月 2023 11:58:26 +0800 Subject: [PATCH] 导出Excel,@Excel注解使用dictType属性时,如果有大量的字典数据,就会有大量的查询redis(打开、关闭),导致特别慢。于是使用map存储字典数据,相同的key就不需要再次去查询redis,大大提高了导出效率。 --- ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java index 479aea6..96e437b 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java @@ -5,7 +5,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.exception.ServiceException; /** * 安全服务工具类 @@ -25,7 +25,7 @@ } catch (Exception e) { - throw new CustomException("获取用户ID异常", HttpStatus.UNAUTHORIZED); + throw new ServiceException("获取用户ID异常", HttpStatus.UNAUTHORIZED); } } @@ -40,7 +40,7 @@ } catch (Exception e) { - throw new CustomException("获取部门ID异常", HttpStatus.UNAUTHORIZED); + throw new ServiceException("获取部门ID异常", HttpStatus.UNAUTHORIZED); } } @@ -55,7 +55,7 @@ } catch (Exception e) { - throw new CustomException("获取用户账户异常", HttpStatus.UNAUTHORIZED); + throw new ServiceException("获取用户账户异常", HttpStatus.UNAUTHORIZED); } } @@ -70,7 +70,7 @@ } catch (Exception e) { - throw new CustomException("获取用户信息异常", HttpStatus.UNAUTHORIZED); + throw new ServiceException("获取用户信息异常", HttpStatus.UNAUTHORIZED); } } -- Gitblit v1.9.2