You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
3.3 KiB
87 lines
3.3 KiB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>登录用户</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<!--标准mui.css-->
|
|
<link rel="stylesheet" href="../../lib/mui/css/mui.min.css">
|
|
<!--App自定义的css-->
|
|
<link rel="stylesheet" type="text/css" href="../../lib/mui/css/app.css"/>
|
|
<style>
|
|
.title{
|
|
margin: 20px 15px 7px;
|
|
color: #6d6d72;
|
|
font-size: 15px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<script src="../../lib/mui/js/mui.min.js"></script>
|
|
<script type="text/javascript">
|
|
mui.ready(function() {
|
|
var appid = "";
|
|
var appsecret = "";
|
|
var domain = "";
|
|
mui.ajax("/baseService/mobile/getWxInformation",{
|
|
type: "GET",
|
|
async:false,
|
|
dataType:'json',
|
|
error:function(xhr,status,statusText){
|
|
alert("请求失败,状态:"+statusText+","+status);
|
|
},
|
|
success:function(json){
|
|
var obj = eval(json);
|
|
mui.each(obj,function(index,array){
|
|
appid = array['appid'];
|
|
appsecret = array['appSecret'];
|
|
})
|
|
}
|
|
});
|
|
mui.ajax("/baseService/mobile/getWxDomain",{
|
|
type: "GET",
|
|
async:false,
|
|
dataType:'json',
|
|
error:function(xhr,status,statusText){
|
|
alert("请求失败,状态:"+statusText+","+status);
|
|
},
|
|
success:function(json){
|
|
var obj = eval(json);
|
|
mui.each(obj,function(index,array){
|
|
domain = array['domain'];
|
|
})
|
|
}
|
|
});
|
|
if(GetQueryString("place_id")){
|
|
var state = GetQueryString("state");
|
|
var place_id = GetQueryString("place_id");
|
|
redirect_uri ="http://"+domain+"/baseService/html/pages/mobile/wx_configure_openid.html?place_id="+place_id+"&state="+state;
|
|
}
|
|
if(GetQueryString("type")){
|
|
var type = GetQueryString("type");
|
|
var redirect_uri = "http://"+domain+"/baseService/html/pages/mobile/wx_configure_openid.html?type="+type;
|
|
}
|
|
if(GetQueryString("person_id")){
|
|
var person_id = GetQueryString("person_id");
|
|
var redirect_uri = "http://"+domain+"/baseService/html/pages/mobile/wx_configure_openid.html?person_id="+person_id;
|
|
}
|
|
var getCodeUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appid+"&redirect_uri="+redirect_uri+"&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect";
|
|
if(!GetQueryString("code")){
|
|
window.location.href = getCodeUrl;
|
|
}
|
|
function GetQueryString(name)
|
|
{
|
|
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
|
|
var r = window.location.search.substr(1).match(reg);//search,查询?后面的参数,并匹配正则
|
|
if(r!=null){
|
|
return unescape(r[2]);
|
|
}else{
|
|
return null;
|
|
}
|
|
}
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |