2
0

feat: 登录认证的类型分为sys/u,对应系统和用户平台

This commit is contained in:
TsMask
2024-11-27 15:23:49 +08:00
parent b7e8da2091
commit 5b8c1b1e94
25 changed files with 262 additions and 79 deletions

View File

@@ -8,6 +8,7 @@ import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;
import org.wfc.common.core.constant.UserConstants;
import org.wfc.common.core.context.SecurityContextHolder;
import org.wfc.common.core.domain.LoginUser;
import org.wfc.common.core.text.Convert;
import org.wfc.common.core.utils.StringUtils;
import org.wfc.common.core.web.domain.BaseEntity;
@@ -15,7 +16,6 @@ import org.wfc.common.datascope.annotation.DataScope;
import org.wfc.common.security.utils.SecurityUtils;
import org.wfc.system.api.domain.SysRole;
import org.wfc.system.api.domain.SysUser;
import org.wfc.system.api.model.LoginUser;
/**
* 数据过滤处理
@@ -66,10 +66,10 @@ public class DataScopeAspect
protected void handleDataScope(final JoinPoint joinPoint, DataScope controllerDataScope)
{
// 获取当前的用户
LoginUser loginUser = SecurityUtils.getLoginUser();
LoginUser<SysUser> loginUser = SecurityUtils.getLoginUser();
if (StringUtils.isNotNull(loginUser))
{
SysUser currentUser = loginUser.getSysUser();
SysUser currentUser = loginUser.getUser();
// 如果是超级管理员,则不过滤数据
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
{