|
@@ -10,9 +10,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
+import org.jeecg.common.system.vo.LoginUser;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecg.modules.ctop.entity.Advertiser;
|
|
|
import org.jeecg.modules.ctop.entity.Project;
|
|
@@ -86,10 +88,16 @@ public class ProjectController {
|
|
|
public Map<String, Object> responsibleList(String userId) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
- String roleCode = materialReportMapper.getRoleCodeByUserId(userId);
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ if (Check.isNull(sysUser)) {
|
|
|
+ map.put("success", false);
|
|
|
+ map.put("code", -1);
|
|
|
+ }
|
|
|
+
|
|
|
+ String roleCode = materialReportMapper.getRoleCodeByUserId(sysUser.getId());
|
|
|
QueryWrapper<Project> queryWrapper = new QueryWrapper<>();
|
|
|
if (!"admin".equals(roleCode)) {
|
|
|
- queryWrapper.eq("user_id", userId);
|
|
|
+ queryWrapper.eq("user_id", sysUser.getId());
|
|
|
queryWrapper.orderByDesc("create_time");
|
|
|
}
|
|
|
List<Project> projects = projectMapper.selectList(queryWrapper);
|