拦截处理

master
cheney 2 years ago
parent f4502cd67b
commit 81d1a277b8
  1. 3
      src/main/java/com/huoran/iasf/service/impl/SysColumnServiceImpl.java
  2. 3
      src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java

@ -1,5 +1,6 @@
package com.huoran.iasf.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -91,7 +92,7 @@ public class SysColumnServiceImpl extends ServiceImpl<SysColumnMapper, SysColumn
@Override
public List<SysColumn> listWithTreeMenuVisible(PaginationColumnReqVO column) {
if (column.getRole().equals("admin")||column.isIsadmin()){
if (column.getRole()!=null&&column.getRole().equals("admin") || ObjectUtil.isNotNull(column.isIsadmin()) && column.isIsadmin()){
throw new IllegalArgumentException("参数名不能包含admin");
}
//查询所有栏目

@ -1,5 +1,6 @@
package com.huoran.iasf.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -74,7 +75,7 @@ public class SysContentServiceImpl extends ServiceImpl<SysContentMapper, SysCont
@Override
public R newlyPublishedArticles(PageContentReqVO reqVO) {
if (reqVO.getRole().equals("admin")||reqVO.isIsadmin()){
if (reqVO.getRole()!=null&&reqVO.getRole().equals("admin") || ObjectUtil.isNotNull(reqVO.isIsadmin()) && reqVO.isIsadmin()){
throw new IllegalArgumentException("参数名不能包含admin");
}
Page<PageContentRespVO> page = new Page<PageContentRespVO>(reqVO.getPageNum(), reqVO.getPageSize());

Loading…
Cancel
Save