Pikachu Ren dec75c4f82 fix issue #15
fix server_use issue
2025-06-16 21:23:40 +08:00

139 lines
6.1 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN" data-theme="light" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OpenList Token 获取工具</title>
<link rel="stylesheet" type="text/css" href="/static/style.css">
<link href="https://jsd.oplist.org/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://jsd.oplist.org/npm/sweetalert2@11.22.0/dist/sweetalert2.all.min.js"></script>
</head>
<body>
<div class="toggle-theme">
<button class="btn btn-outline-secondary" onclick="toggleTheme()">切换主题</button>
</div>
<div class="container form-container">
<h2 class="text-center mb-4">🔐 OpenList Token 获取工具</h2>
<div class="mb-3">
<label for="site-select" class="form-label">网盘名称</label>
<select id="site-select" class="form-select">
<option value="onedrive_go" selected>OneDrive 企业账号</option>
<option value="onedrive_pr">OneDrive 个人账号</option>
<option value="onedrive_cn">OneDrive 世纪互联</option>
<option value="onedrive_us">OneDrive 美国版本</option>
<option value="onedrive_de">OneDrive 德国版本</option>
<option value="alicloud_qr">阿里云盘 应用登录</option>
<option value="alicloud_oa">阿里云盘 直接登录</option>
<option value="baiduyun_go">百度网盘 验证登录</option>
<option value="baiduyun_ob">百度网盘 OOB 验证</option>
<option value="115cloud_go">115 网盘 验证登录</option>
<option value="123cloud_go">123 网盘 直接登录</option>
<option value="googleui_go">GoogleDrive Login</option>
<option value="yandexui_go">YandexDrive Login</option>
</select>
</div>
<div class="mb-3" style="margin-top: 15px">
<input type="checkbox" id="server_use" class="form-check-input">
<label for="server_use" class="form-check-label">使用 OpenList 提供的参数</label>
</div>
<div class="mb-3" id="client-id-view">
<label for="client-id" class="form-label">客户端IDClientID/AppID</label>
<input type="text" id="client-id" class="form-control">
</div>
<div class="mb-3">
<label for="app-secret" class="form-label">应用秘钥 (AppKey/Secret)</label>
<input type="text" id="app-secret" class="form-control">
</div>
<div class="mb-3" id="secret-key-view">
<label for="secret-key" class="form-label">访问秘钥SecretKey/Key</label>
<input type="text" id="secret-key" class="form-control">
</div>
<div class="mb-3">
<label for="callback-url" class="form-label">回调地址Callback URL</label>
<input type="text" id="callback-url" class="form-control" value="https://api.oplist.org/onedrive/callback"
readonly onclick="autoCopy(this)">
</div>
<div class="d-grid gap-2 mb-3">
<button class="btn btn-primary" onclick="getLogin()">获取 Token</button>
</div>
<div class="d-grid gap-2 mb-3">
<button class="btn btn-primary" onclick="getLogin(true)">刷新 Token</button>
</div>
<div class="mb-3">
<label for="access-token" class="form-label">访问令牌Access Token</label>
<textarea id="access-token" class="form-control" rows="3" readonly onclick="autoCopy(this)"></textarea>
</div>
<div class="mb-3">
<label for="refresh-token" class="form-label">刷新令牌Refresh Token</label>
<textarea id="refresh-token" class="form-control" rows="3" readonly onclick="autoCopy(this)"></textarea>
</div>
<div class="mb-3" id="sharepoint-url-view">
<label for="sharepoint-url" class="form-label">SharePoint Site URL</label>
<label for="sharepoint-url"></label><input type="text" id="sharepoint-url" class="form-control">
</div>
<div class="d-grid gap-2 mb-3" id="sharepoint-btn-view">
<button class="btn btn-primary" onclick="getSiteID()">获取 SharePoint 站点ID</button>
</div>
<div class="mb-3" id="sharepoint-uid-view">
<label for="sharepoint-id" class="form-label">SharePoint Site ID</label>
<textarea id="sharepoint-id" class="form-control" rows="3" readonly onclick="autoCopy(this)"></textarea>
</div>
<div class="text-muted text-center">
<p style="text-align:center">
本工具所有信息只以Cookie形式存储于浏览器本地<br>
开源于 <a href="https://github.com/OpenListTeam/cf-worker-api" target="_blank">GitHub</a> | By <a
href="https://github.com/OpenListTeam"
target="_blank">OpenListTeam</a>
</p>
</div>
</div>
<!-- 阿里云盘扫码v2模态框 -->
<div id="qr-modal" class="qr-modal">
<div class="qr-modal-content">
<span class="close-btn" onclick="closeQRModal()">&times;</span>
<h4>阿里云盘扫码登录v2</h4>
<div id="qr-code-container" class="qr-code-container" style="display: none;">
<div id="qr-code-display"></div>
</div>
<div id="qr-status" class="qr-status" style="display: none;"></div>
<div class="mt-3">
<button id="refresh-qr-btn" class="btn btn-secondary" onclick="refreshQRCode()" style="display: none;">刷新二维码</button>
<button class="btn btn-secondary" onclick="closeQRModal()">关闭</button>
</div>
</div>
</div>
<script src="/static/login.js"></script>
<script src="/static/token.js"></script>
<script src="/static/theme.js"></script>
<script src="/static/aliv2.js"></script>
<script src="/static/spoid.js"></script>
<script src="/static/input.js"></script>
<script>
getToken();
// 阿里云盘扫码v2相关变量
let alicloud2SessionId = null;
let alicloud2CheckInterval = null;
let alicloud2StartTime = null;
let clientFingerprint = null;
// 点击模态框外部关闭
window.onclick = function (event) {
const modal = document.getElementById('qr-modal');
if (event.target === modal) {
closeQRModal();
}
}
</script>
</body>
</html>