Exemplo n.º 1
0
 /**
  * 查询栏目 生成json数据
  *
  * @return
  */
 public String getChannel() {
   if (site != null && site.getId() != null && site.getId().trim().length() > 0) {
     if (isAdminLogin()) {
       channelList = channelService.findByPar(site.getId(), "par");
     } else {
       channelList = channelService.findByRoles(site.getId(), getLoginRoleIdsSql());
     }
     if (channelList != null && channelList.size() > 0) {
       StringBuffer sb = new StringBuffer();
       sb.append("[");
       for (int i = 0; i < channelList.size(); i++) {
         if (i > 0) {
           sb.append(",");
         }
         sb.append(
             "{id:'"
                 + channelList.get(i).getId()
                 + "',name:'"
                 + channelList.get(i).getName()
                 + "'}");
       }
       sb.append("]");
       write(sb.toString(), "UTF-8");
     }
   }
   return null;
 }
Exemplo n.º 2
0
 /**
  * 单个站点授权页面
  *
  * @return
  */
 public String authPage() {
   if (site != null
       && site.getId().trim().length() > 0
       && role != null
       && role.getId().trim().length() > 0) {
     site = siteService.findById(site.getId());
     // 判断是否有站点管理权限
     roleSite = roleSiteService.findBySiteRole(site.getId(), role.getId());
     channelTreeContent = new StringBuffer();
     channelService.createTree(
         channelTreeContent,
         (isAdminLogin() ? "admin" : getLoginRoleIdsSql()),
         site.getId(),
         role.getId(),
         "par",
         null,
         null,
         "checkbox");
   }
   return "authPage";
 }