<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<jsp:include page="../../common.jsp" />
<title></title>
</head>
<body>

	<input type="hidden" id="appId" value="${appId }">
	<script type="text/javascript">
function GetQueryString(name){
     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}

/**
 * 判断是否是微信浏览器
 */
function isWeiXin(){
    var ua = window.navigator.userAgent.toLowerCase();
    if(ua.match(/MicroMessenger/i) == 'micromessenger'){
        return true;
    }else{
        return false;
    }
}


/**
 * 业务分流
 */
 var uri="${url}";
var appId=document.getElementById("appId").value;
if(isWeiXin()){
	var jump='https://open.weixin.qq.com/connect/oauth2/authorize?appid='+appId+'&redirect_uri='+encodeURIComponent(uri)+'&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect';
	window.location=jump;
}else{
	window.location=uri;
}
</script>
</body>
</html>