package com.sino.rescue.oauth.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sino.weixin.oauth.util.AdvancedUtil;

public class ConformServiceServlet extends HttpServlet{
	private static final long serialVersionUID = 1L;
private AdvancedUtil util = new AdvancedUtil();
	
	@Override
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
		response.setCharacterEncoding("gb2312");  // 用户同意授权后，能获取到code
		  String code=request.getParameter("code");
		  if (!"authdeny".equals(code)) {
			   String cmd=request.getParameter("cmd");
				if(cmd.equals("notice")){	//中道通知
					response.sendRedirect("https://mp.weixin.qq.com/mp/homepage?__biz=MjM5NzEzOTkwNw%3D%3D&hid=10&sn=6d3ca4446f031c10222ca8a232478f6f");
				}else if(cmd.equals("system")){ //中道制度
					response.sendRedirect("https://mp.weixin.qq.com/mp/homepage?__biz=MjM5NzEzOTkwNw%3D%3D&hid=11&sn=1debd0fd682bd8c28d8ba46a8dda6925");
				}else if(cmd.equals("parameter")){	//技术参数
					response.sendRedirect("https://mp.weixin.qq.com/mp/homepage?__biz=MjM5NzEzOTkwNw%3D%3D&hid=12&sn=a0cb93af7b306572efac15456884df74");
				}
			  
			}
	}
}
