index.html
1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="jquery.2.1.3.min.js"></script>
</head>
<body>
<script type="text/javascript">
(function(){
function getQuery(name) {
var result = window.location.search.match(new RegExp("[\?\&]" + name + "=([^\&]+)", "i"));
if (result == null || result.length < 1)
return undefined;
return decodeURIComponent(result[1]);
}
var code = getQuery('code');
var ua = window.navigator.userAgent.toLowerCase();
if (code && ua.match(/MicroMessenger/i) == 'micromessenger') {
console.log(code);
window.location.href = 'http://dev.bigbang.gaoxiaobang.com/dist'+ window.location.search;
} else {
$.ajax({
type: 'GET',
url: 'http://dev.bigbang.gaoxiaobang.com/wx-qa/getRequestCodeUrl.htm?url=http://dev.bigbang.gaoxiaobang.com/dist/',
timeout: 15000,
success: function(data) {
console.log(data);
window.location.href = data;
},
error: function(xhr, type) {
alert('Ajax error!')
}
})
}
})();
</script>
</body>
</html>