Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
ee9bcd1b95
|
|
@ -81,11 +81,11 @@ public class DataScopeAspect
|
||||||
}
|
}
|
||||||
// 获取当前的用户
|
// 获取当前的用户
|
||||||
LoginUser loginUser = tokenService.getLoginUser();
|
LoginUser loginUser = tokenService.getLoginUser();
|
||||||
SysUser currentUser = loginUser.getSysUser();
|
if (StringUtils.isNotNull(loginUser))
|
||||||
if (currentUser != null)
|
|
||||||
{
|
{
|
||||||
|
SysUser currentUser = loginUser.getSysUser();
|
||||||
// 如果是超级管理员,则不过滤数据
|
// 如果是超级管理员,则不过滤数据
|
||||||
if (!currentUser.isAdmin())
|
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
|
||||||
{
|
{
|
||||||
dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),
|
dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),
|
||||||
controllerDataScope.userAlias());
|
controllerDataScope.userAlias());
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,11 @@ import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||||
import com.ruoyi.common.security.service.TokenService;
|
import com.ruoyi.common.security.service.TokenService;
|
||||||
import com.ruoyi.system.api.model.LoginUser;
|
import com.ruoyi.system.api.model.LoginUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义权限实现
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
@Aspect
|
@Aspect
|
||||||
@Component
|
@Component
|
||||||
public class PreAuthorizeAspect
|
public class PreAuthorizeAspect
|
||||||
|
|
@ -42,34 +47,56 @@ public class PreAuthorizeAspect
|
||||||
return point.proceed();
|
return point.proceed();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtils.isEmpty(annotation.hasPermi()) && hasPermi(annotation.hasPermi()))
|
if (!StringUtils.isEmpty(annotation.hasPermi()))
|
||||||
{
|
|
||||||
return point.proceed();
|
|
||||||
}
|
|
||||||
else if (StringUtils.isEmpty(annotation.lacksPermi()) && hasPermi(annotation.lacksPermi()))
|
|
||||||
{
|
|
||||||
return point.proceed();
|
|
||||||
}
|
|
||||||
else if (StringUtils.isEmpty(annotation.hasAnyPermi()) && hasAnyPermi(annotation.hasAnyPermi()))
|
|
||||||
{
|
|
||||||
return point.proceed();
|
|
||||||
}
|
|
||||||
else if (StringUtils.isEmpty(annotation.hasRole()) && hasRole(annotation.hasRole()))
|
|
||||||
{
|
|
||||||
return point.proceed();
|
|
||||||
}
|
|
||||||
else if (StringUtils.isEmpty(annotation.lacksRole()) && lacksRole(annotation.lacksRole()))
|
|
||||||
{
|
|
||||||
return point.proceed();
|
|
||||||
}
|
|
||||||
else if (StringUtils.isEmpty(annotation.hasAnyRoles()) && hasAnyRoles(annotation.hasAnyRoles()))
|
|
||||||
{
|
|
||||||
return point.proceed();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
if (hasPermi(annotation.hasPermi()))
|
||||||
|
{
|
||||||
|
return point.proceed();
|
||||||
|
}
|
||||||
throw new PreAuthorizeException();
|
throw new PreAuthorizeException();
|
||||||
}
|
}
|
||||||
|
else if (!StringUtils.isEmpty(annotation.lacksPermi()))
|
||||||
|
{
|
||||||
|
if (lacksPermi(annotation.lacksPermi()))
|
||||||
|
{
|
||||||
|
return point.proceed();
|
||||||
|
}
|
||||||
|
throw new PreAuthorizeException();
|
||||||
|
}
|
||||||
|
else if (!StringUtils.isEmpty(annotation.hasAnyPermi()))
|
||||||
|
{
|
||||||
|
if (hasAnyPermi(annotation.hasAnyPermi()))
|
||||||
|
{
|
||||||
|
return point.proceed();
|
||||||
|
}
|
||||||
|
throw new PreAuthorizeException();
|
||||||
|
}
|
||||||
|
else if (!StringUtils.isEmpty(annotation.hasRole()))
|
||||||
|
{
|
||||||
|
if (hasRole(annotation.hasRole()))
|
||||||
|
{
|
||||||
|
return point.proceed();
|
||||||
|
}
|
||||||
|
throw new PreAuthorizeException();
|
||||||
|
}
|
||||||
|
else if (StringUtils.isEmpty(annotation.lacksRole()))
|
||||||
|
{
|
||||||
|
if (lacksRole(annotation.lacksRole()))
|
||||||
|
{
|
||||||
|
return point.proceed();
|
||||||
|
}
|
||||||
|
throw new PreAuthorizeException();
|
||||||
|
}
|
||||||
|
else if (StringUtils.isEmpty(annotation.hasAnyRoles()))
|
||||||
|
{
|
||||||
|
if (hasAnyRoles(annotation.hasAnyRoles()))
|
||||||
|
{
|
||||||
|
return point.proceed();
|
||||||
|
}
|
||||||
|
throw new PreAuthorizeException();
|
||||||
|
}
|
||||||
|
|
||||||
|
return point.proceed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -76,12 +76,12 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||||
public List<SysDictData> selectDictDataByType(String dictType)
|
public List<SysDictData> selectDictDataByType(String dictType)
|
||||||
{
|
{
|
||||||
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
|
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
|
||||||
if (StringUtils.isNotNull(dictDatas))
|
if (StringUtils.isNotEmpty(dictDatas))
|
||||||
{
|
{
|
||||||
return dictDatas;
|
return dictDatas;
|
||||||
}
|
}
|
||||||
dictDatas = dictDataMapper.selectDictDataByType(dictType);
|
dictDatas = dictDataMapper.selectDictDataByType(dictType);
|
||||||
if (StringUtils.isNotNull(dictDatas))
|
if (StringUtils.isNotEmpty(dictDatas))
|
||||||
{
|
{
|
||||||
DictUtils.setDictCache(dictType, dictDatas);
|
DictUtils.setDictCache(dictType, dictDatas);
|
||||||
return dictDatas;
|
return dictDatas;
|
||||||
|
|
|
||||||
|
|
@ -71,9 +71,9 @@ export default {
|
||||||
value: {
|
value: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
if (val !== this.currentValue) {
|
if (val !== this.currentValue) {
|
||||||
this.currentValue = val;
|
this.currentValue = val === null ? "" : val;
|
||||||
if (this.Quill) {
|
if (this.Quill) {
|
||||||
this.Quill.pasteHTML(this.value);
|
this.Quill.pasteHTML(this.currentValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue