-
Notifications
You must be signed in to change notification settings - Fork 37
/
index.html
43 lines (39 loc) · 2.62 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>
<body>
<! --修改地方1-->
<p>未更新</p>
<div>
<div>
<! --修改地方2-->
<a
href='https://login.microsoftonline.com/common/oauth2/v2.0/authorize?scope=https%3A%2F%2Fgraph.microsoft.com%2FFiles.ReadWrite.All+Files.Read.All+Sites.Read.All+Sites.ReadWrite.All+User.Read.All+User.ReadWrite.All+Directory.Read.All+Directory.ReadWrite.All+Mail.Read+Mail.ReadWrite+MailboxSettings.Read+MailboxSettings.ReadWrite+offline_access&response_type=code&client_id=你的应用id&redirect_uri=你的项目主页'>click
here to get your refresh code</a>
</div>
<div id='info'></div>
<form action="https://login.microsoftonline.com/common/oauth2/v2.0/token" method="POST" style="display:none;">
<! --修改地方3-->
<input type="text" name="client_id" placeholder="client_id" value="你的应用id" />
<! --修改地方4-->
<input type="text" name="client_secret" placeholder="client_secret"
value="你的应用机密" />
<input type="text" name="grant_type" placeholder="authorization_code" value="authorization_code" />
<input type="text" name="requested_token_use" placeholder="on_behalf_of" value="on_behalf_of" />
<! --修改地方5-->
<input type="text" name="redirect_uri" placeholder="redirect_uri"
value="你的项目主页" />
<input type="text" name="code" placeholder="code" id="code" />
<input type="submit" id='submit' />
</form>
<script>
//https://api.moeclub.org/onedrive-login?error=access_denied&error_description=AADSTS650051%3a+Using+application+%27OneDrive+for+API%27+is+currently+not+supported+for+your+organization+whu.edu.cn+because+it+is+in+an+unmanaged+state.+An+administrator+needs+to+claim+ownership+of+the+company+by+DNS+validation+of+whu.edu.cn+before+the+application+OneDrive+for+API+can+be+provisioned.%0d%0aTrace+ID%3a+03c26bfa-d4e7-4c28-bf15-fd39e4921900%0d%0aCorrelation+ID%3a+3233c0aa-7100-44bd-99f4-309c8e6288e5Timestamp%3a+2020-01-08+07%3a31%3a26Z
let url = new URL(window.location.href);
if (url.searchParams.get('code')) {
document.getElementById('code').value = url.searchParams.get('code');
document.getElementById('submit').click();
} else if (url.searchParams.get('error')) {
document.getElementById('info').innerText = url.searchParams.get('error') + ":\n" + url.searchParams
.get('error_description');
}
</script>
</body>
</html>