nutz redirect

2070 단어 nutzredirect

 
 
 
 
 
 
 
@At("/TobindBussinessJsp")
	@Ok("jsp:weichatjsp.${obj}")
	public String  singalbindBussiness(@Param("code") String code,@Param("openId") String openId,  HttpServletRequest request) {
		String obj="discount_open";
        if( null != openId && "" != openId ){
			
		}else {
			 openId = CommonUtil.getOpenId(code);
		}
		TUser tuser = userService.findTUserByOpenId(openId);
		int isBindMobile =0; 
		if(null != tuser  &&  null != tuser.getId()  && tuser.getId() >0  ){
			isBindMobile =1; //     ,       
		}
		int isBindBusiness = 0;
		Integer model = null;
		if(tuser != null) {
			model = tuser.getMode();
		}
		if(isBindMobile == 1 && model != null) {
			isBindBusiness = 1;
			request.setAttribute("model", model);
			obj="discount_update";
		}
		request.setAttribute("isBindBusiness", isBindBusiness);
		request.setAttribute("isBindMobile", isBindMobile);
		request.setAttribute("openId", openId);
		return obj;
	}

 
 
 
 @At("/login")
    @Ok("redirect:${obj==true?'/home':'/toLogin'}")
    @Filters
    public boolean login(HttpServletRequest req,HttpSession session){
        String userName=req.getParameter("name");
        String pwd=req.getParameter("pwd");
        boolean result=false;        
        if(!isBlank(userName) && !isBlank(pwd)){
                    User user=new User();
            
            if(user!=null){
                result=true;//      
                session.setAttribute("user", user);
            }
        
        return result;
    }

 
 
 
 
 
 
 
 
 

좋은 웹페이지 즐겨찾기