Package org.jeecgframework.web.system.pojo.base

Examples of org.jeecgframework.web.system.pojo.base.Client


      if (u != null) {
        // if (user.getUserKey().equals(u.getUserKey())) {
        if (true) {
          message = "用户: " + user.getUserName() + "["
              + u.getTSDepart().getDepartname() + "]" + "登录成功";
          Client client = new Client();
          client.setIp(IpUtil.getIpAddr(req));
          client.setLogindatetime(new Date());
          client.setUser(u);
          ClientManager.getInstance().addClinet(session.getId(),
              client);
          // 添加登陆日志
          systemService.addLog(message, Globals.Log_Type_LOGIN,
              Globals.Log_Leavel_INFO);
View Full Code Here


   * @param user
   * @return
   */
  private Map<String, TSFunction> getUserFunction(TSUser user) {
    HttpSession session = ContextHolderUtils.getSession();
    Client client = ClientManager.getInstance().getClient(session.getId());
    if (client.getFunctions() == null) {
      Map<String, TSFunction> loginActionlist = new HashMap<String, TSFunction>();
      List<TSRoleUser> rUsers = systemService.findByProperty(
          TSRoleUser.class, "TSUser.id", user.getId());
      for (TSRoleUser ru : rUsers) {
        TSRole role = ru.getTSRole();
        List<TSRoleFunction> roleFunctionList = systemService
            .findByProperty(TSRoleFunction.class, "TSRole.id",
                role.getId());
        for (TSRoleFunction roleFunction : roleFunctionList) {
          TSFunction function = roleFunction.getTSFunction();
          loginActionlist.put(function.getId(), function);
        }
      }
      client.setFunctions(loginActionlist);
    }
    return client.getFunctions();
  }
View Full Code Here

   * 在controller前拦截
   */
  public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object object) throws Exception {
    String requestPath = ResourceUtil.getRequestPath(request);// 用户访问的资源地址
    HttpSession session = ContextHolderUtils.getSession();
    Client client = ClientManager.getInstance().getClient(session.getId());
    if(client == null){
      client = ClientManager.getInstance().getClient(
          request.getParameter("sessionId"));
    }
    if (excludeUrls.contains(requestPath)) {
      return true;
    } else {
      if (client != null && client.getUser()!=null ) {
         if(!hasMenuAuth(request)){
           response.sendRedirect("loginController.do?noAuth");
          //request.getRequestDispatcher("webpage/common/noAuth.jsp").forward(request, response);
          return false;
        }
        String functionId=oConvertUtils.getString(request.getParameter("clickFunctionId"));
        if(!oConvertUtils.isEmpty(functionId)){
          Set<String> operationCodes = systemService.getOperationCodesByUserIdAndFunctionId(client.getUser().getId(), functionId);
          request.setAttribute("operationCodes", operationCodes);
        
        }
        if(!oConvertUtils.isEmpty(functionId)){
          List<String> allOperation=this.systemService.findListbySql("SELECT operationcode FROM t_s_operation  WHERE functionid='"+functionId+"'");
           
          List<String> newall = new ArrayList<String>();
          if(allOperation.size()>0){
            for(String s:allOperation){
                s=s.replaceAll(" ", "");
              newall.add(s);
            }            
            String hasOperSql="SELECT operation FROM t_s_role_function fun, t_s_role_user role WHERE  " +
              "fun.functionid='"+functionId+"' AND fun.operation!=''  AND fun.roleid=role.roleid AND role.userid='"+client.getUser().getId()+"' ";
            List<String> hasOperList = this.systemService.findListbySql(hasOperSql);
              for(String strs:hasOperList){
                  for(String s:strs.split(",")){
                      s=s.replaceAll(" ", "");
                    newall.remove(s);
View Full Code Here

TOP

Related Classes of org.jeecgframework.web.system.pojo.base.Client

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.