forked from SCFOnedrive/SCFOnedrive.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
43 lines (43 loc) · 1.51 KB
/
index.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
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>OneManager jump page</title>
</head>
<body>
<div id='test1'>
<a id="direct">No link here!</a><br>
If not auto jump, click the link to jump.<br>
如果长时间未跳转,请点击上方链接继续安装。<br>
</div>
<script>
var q = new Array();
var query = window.location.search.substring(1);
//document.getElementById('test1').innerHTML=query;
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
q[pair[0]]=pair[1];
}
var url = q['state'];
var code = q['code'];
if (!!url && !!code) {
url = decodeURIComponent(url);
if (url.indexOf("AddDisk=")>1) {
var lasturl = url+"&code="+code;
} else {
if (url.substr(-1)!="/") url+="/";
var lasturl = url+"?AddDisk&Driver=MS365&install2&authorization_code&code="+code;
}
document.getElementById('direct').innerText = lasturl;
document.getElementById('direct').href = lasturl;
window.location = lasturl;
} else {
var str='Error! 有误!';
if (!url) str+='No url! url参数为空!';
else document.getElementById('test1').innerHTML='<a href="'+decodeURIComponent(decodeURIComponent(url))+'">'+decodeURIComponent(decodeURIComponent(url))+'</a><br>';
if (!code) str+='No code from MS! 微软code为空!';
document.getElementById('test1').innerHTML+=str+'<br>'+decodeURIComponent(query.replace(/\+/g,'%20'));
//alert(str);
}
</script>
</body>
</html>