forked from YCCDSZXH/welearn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
98 lines (95 loc) · 4.11 KB
/
test.html
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!--
* @Description:
* @Author: Viga
* @Date: 2021-07-07 15:29:26
* @LastEditTime: 2022-04-22 14:33:38
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ä¸æµ·å¤è¯æè²åºç社</title>
<script src="./assets/js/baseurl.js"></script>
<script src="./assets/js/polyfill.min.js"></script>
<script src="./assets/js/browser.min.js"></script>
</head>
<body>
<script>
var returnUrl = getUrlParam('returnUrl')
var action = decodeURIComponent(getUrlParam('action'))
var clientId = decodeURIComponent(getUrlParam('clientId'))
if (!isMobile()) {
switch (action) {
case 'register':
if (clientId) {
window.location.href = registerUrl + '?returnUrl=' + returnUrl + '&clientId=' + clientId
} else {
window.location.href = registerUrl + '?returnUrl=' + returnUrl
}
break;
case 'login':
if (clientId) {
window.location.href = loginUrl + '?returnUrl=' + returnUrl + '&clientId=' + clientId
} else {
window.location.href = loginUrl + '?returnUrl=' + returnUrl
}
break;
default:
if (clientId) {
window.location.href = loginUrl + '?returnUrl=' + returnUrl + '&clientId=' + clientId
} else {
window.location.href = loginUrl + '?returnUrl=' + returnUrl
}
break;
}
} else {
switch (action) {
case 'register':
if (clientId) {
window.location.href = baseUrl + 'app/index.html#/RegisterPage?returnUrl=' + returnUrl + '&clientId=' + clientId
} else {
window.location.href = baseUrl + 'app/index.html#/RegisterPage?returnUrl=' + returnUrl
}
break;
case 'login':
if (clientId) {
window.location.href = baseUrl + 'app/index.html#/LoginPage?returnUrl=' + returnUrl + '&clientId=' + clientId
} else {
window.location.href = baseUrl + 'app/index.html#/LoginPage?returnUrl=' + returnUrl
}
break;
default:
if (clientId) {
window.location.href = baseUrl + 'app/index.html#/LoginPage?returnUrl=' + returnUrl + '&clientId=' + clientId
} else {
window.location.href = baseUrl + 'app/index.html#/LoginPage?returnUrl=' + returnUrl
}
break;
}
}
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)")
var r = window.location.search.substr(1).match(reg);
if (r != null && r != 'null') return r[2]; return '';
}
function isMobile() {
var sUserAgent = navigator.userAgent.toLowerCase();
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid = sUserAgent.match(/android/i) == "android";
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
return true;
} else {
return false;
}
}
</script>
</body>
</html>