<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page import="com.Admin.daoimpl.AdminUserDaoImpl" %> <%@ page import="com.Admin.vo.SubType"%> <%@ page import="com.Admin.vo.SuperType"%> <%@ page import="com.Admin.vo.Product"%> <%@ page import="com.Admin.vo.Attr"%> <%@ page import="net.sf.json.JSONArray"%> <%@ page import="net.sf.json.JSONObject"%> <%@ page import="com.Admin.vo.App"%> <%@ page import="com.Admin.vo.User"%> <%@ page import="com.Admin.vo.AppUser"%> <%@ page import="java.util.ArrayList"%> <%@ page import="java.util.List"%> <%@ page import="java.net.URLDecoder"%> <%@ page import="com.common.IConstant"%> <%@ page import="com.common.Redis"%> <%@ page import="com.common.ReadDBPropertiesFile"%> <%@ page import="redis.clients.jedis.Jedis"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="cf" uri="/WEB-INF/els.tld" %> <% response.setCharacterEncoding("utf-8"); request.setCharacterEncoding("utf-8"); String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String realPath = "http://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath()+request.getServletPath().substring(0,request.getServletPath().lastIndexOf("/")+1); String context = request.getServletPath().substring(1,request.getServletPath().lastIndexOf("/")); String apppath = getServletContext().getRealPath("/"+context); String force = request.getParameter("t"); String appid = request.getParameter("appid"); //userid = URLDecoder.decode(userid,"utf-8"); User user = null; Jedis redis = null; try{ user = (User)request.getSession().getAttribute(IConstant.CURRENT_USER); }catch(Exception ex){ } int role = 0; if(appid==null){ appid = (String)request.getSession().getAttribute(IConstant.CURRENT_APPID); } else{ request.getSession().setAttribute(IConstant.CURRENT_APPID,appid); } if(appid==null){ if(user==null){ request.getSession().setAttribute(IConstant.CURRENT_PAGE,basePath+"m/types.jsp"); String url = basePath+"m/mlogin.html"; response.sendRedirect(url); return; } //判断有无需要转向的页面 String pageurl = (String)request.getSession().getAttribute(IConstant.CURRENT_PAGE); if(!(pageurl==null||pageurl.isEmpty())){ response.sendRedirect(pageurl); request.getSession().removeAttribute(IConstant.CURRENT_PAGE); return; } role = user.getRole(); appid=user.getAppid(); }else{ if(user!=null){ role = user.getRole(); } } JSONObject app = IConstant.getAppInfo(appid); JSONObject jsonUser = JSONObject.fromObject(user); redis = Redis.getReadRedis(); //get data String str = IConstant.getUserRoleInfo(appid, user.getUserid(), String.valueOf(role),null, null); JSONObject rtn = JSONObject.fromObject(str); JSONArray jsonTypes = null; jsonTypes = rtn.getJSONArray("types"); // String key = IConstant.KEY_TYPES(appid, role); // if(force!=null) redis.expire(key,0); // String str = redis.get(key); // if(str==null){ // jsonTypes = IConstant.getTypes(appid, String.valueOf(role)); // redis.set(key,jsonTypes.toString()); // } // else // { // jsonTypes = JSONArray.fromObject(str); // } // if(appid.equals("1")){ // for(int i=0;i=0;n--) // { // JSONObject r = jsonFavorite.getJSONObject(n); // for(int i=0;i=0;n--) // { // JSONObject r = jsonRecent.getJSONObject(n); // boolean isfound=false; // try{ // String url = r.getString("resourceurl"); // for(int i=0;i andisk课程

加载中...

<%if(recents.size()>0) {%> <%} %> <%for(int i=0;i0){ //out.print("
"); out.print("
"); out.print("

产品:"+sp.getString("typename") +"

"); out.print(""); out.print("
"); } %> <%} %>