Jelajahi Sumber

智能托管

yumeng 3 tahun lalu
induk
melakukan
d8514938cb

+ 8 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/hosting/controller/KuaishouHostingTemplateController.java

@@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.system.service.ISysRoleService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -53,6 +54,8 @@ public class KuaishouHostingTemplateController {
     private IKuaishouHostingTemplateService kuaishouHostingTemplateService;
     @Autowired
     private IKuaiShouVideoGetService videoGetService;
+    @Autowired
+    private ISysRoleService sysRoleService;
 
 
     /**
@@ -111,6 +114,11 @@ public class KuaishouHostingTemplateController {
                                                                 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                                 HttpServletRequest req) {
         Result<IPage<KuaishouHostingTemplate>> result = new Result<>();
+        String userId = kuaishouHostingTemplate.getUserId();
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+        if ("admin".equals(roleCode)) {
+            kuaishouHostingTemplate.setUserId(null);
+        }
         QueryWrapper<KuaishouHostingTemplate> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouHostingTemplate, req.getParameterMap());
         queryWrapper.orderByDesc("create_time");
         Page<KuaishouHostingTemplate> page = new Page<KuaishouHostingTemplate>(pageNo, pageSize);