From 50ac363682595f6d0bcca3e68e0bea6af9617aaa Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 4 Sep 2020 14:47:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7druid=E5=88=B0=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=ACv1.1.23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../com/ruoyi/framework/aspectj/DataScopeAspect.java | 9 +++------ .../system/service/impl/SysDictTypeServiceImpl.java | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 9ef7c4fdc..4302e8cbd 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ UTF-8 1.8 1.3.2 - 1.1.14 + 1.1.23 1.19 2.9.2 2.3.2 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java index 80c1fda0d..a796f841c 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java @@ -79,14 +79,11 @@ public class DataScopeAspect } // 获取当前的用户 LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest()); - if (loginUser == null) { - return; - } - SysUser currentUser = loginUser.getUser(); - if (currentUser != null) + if (StringUtils.isNotNull(loginUser)) { + SysUser currentUser = loginUser.getUser(); // 如果是超级管理员,则不过滤数据 - if (!currentUser.isAdmin()) + if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin()) { dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(), controllerDataScope.userAlias()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java index 8705c4127..2db4341b4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java @@ -76,12 +76,12 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService public List selectDictDataByType(String dictType) { List dictDatas = DictUtils.getDictCache(dictType); - if (null!=dictDatas&&!dictDatas.isEmpty()) + if (StringUtils.isNotEmpty(dictDatas)) { return dictDatas; } dictDatas = dictDataMapper.selectDictDataByType(dictType); - if (null!=dictDatas&&!dictDatas.isEmpty()) + if (StringUtils.isNotEmpty(dictDatas)) { DictUtils.setDictCache(dictType, dictDatas); return dictDatas;