94 lines
2.4 KiB
HTML
94 lines
2.4 KiB
HTML
<!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" />
|
|
|
|
<link rel="shortcut icon" href="/favicon.ico" />
|
|
|
|
<title>Third party</title>
|
|
|
|
<style type="text/css">
|
|
#third-party-body {
|
|
cursor: default;
|
|
height: 100%;
|
|
width: 100%;
|
|
min-height: 100%;
|
|
overflow-x: hidden;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
margin: 0;
|
|
padding: 36px 36px 0 36px;
|
|
border: 0;
|
|
box-sizing: border-box;
|
|
font-family: "Open Sans", sans-serif;
|
|
}
|
|
|
|
#container {
|
|
position: relative;
|
|
margin: 12px 0 60px 0;
|
|
}
|
|
|
|
.text {
|
|
font-size: 18px;
|
|
line-height: 22px;
|
|
text-align: center;
|
|
margin: auto;
|
|
max-width: 560px;
|
|
padding: 0;
|
|
}
|
|
|
|
img {
|
|
display: block;
|
|
width: 100%;
|
|
}
|
|
</style>
|
|
<script>
|
|
function getObjectByLocation(location) {
|
|
if (!location.search || !location.search.length) return null;
|
|
|
|
const searchUrl = location.search.substring(1);
|
|
const object = JSON.parse(
|
|
'{"' +
|
|
decodeURIComponent(
|
|
searchUrl
|
|
.replace(/"/g, '\\"')
|
|
.replace(/&/g, '","')
|
|
.replace(/=/g, '":"')
|
|
) +
|
|
'"}'
|
|
);
|
|
|
|
return object;
|
|
}
|
|
|
|
function renderError(error) {
|
|
var container = document.getElementById("container");
|
|
container.innerHTML = `<img src="/static/images/clouds.png" /><p class="text">${error}</p>`;
|
|
}
|
|
|
|
const urlParams = getObjectByLocation(window.location);
|
|
const code = urlParams ? urlParams.code || null : null;
|
|
const error = urlParams ? urlParams.error || null : null;
|
|
const desktop = urlParams ? urlParams.desktop || false : false;
|
|
const p = urlParams ? urlParams.p || false : false;
|
|
</script>
|
|
</head>
|
|
<body id="third-party-body">
|
|
<div id="container"></div>
|
|
</body>
|
|
<script>
|
|
if (code) {
|
|
localStorage.setItem("code", code);
|
|
|
|
if (desktop && p) {
|
|
window.location.href = `/login.ashx?p=${p}&code=${code}&desktop=true`;
|
|
}
|
|
} else if (error) {
|
|
renderError(error);
|
|
}
|
|
</script>
|
|
</html>
|