使用方法:在站点内新建index.html,把下方代码复制粘贴进去并保存就可以访问了
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>阿里网盘自动每日打卡</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/layui/2.6.8/css/layui.min.css">
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js"></script>
<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/layui/2.6.8/layui.min.js"></script>
<script>
function getTokenInfo() {
var name = document.getElementById("nameInput").value;
var token = document.getElementById("tokenInput").value;
var s = document.getElementById("sInput").value;
var url = "https://shanhe.kim/api/ali/aliv2.php?name=" + name + "&token=" + token + "&s=" + s;
$.ajax({
url: url,
type: "GET",
dataType: "json",
success: function(response) {
if (response.code === 200) {
var message = "代码:" + response.code + "<br>" +
"信息:" + response.message;
if (s === "write") {
message = "任务提交成功";
} else if (s === "read") {
message = "任务查询成功";
var data = response.data;
if (data.length === 0) {
message += "<br>找到匹配的数据:<br>今天还未执行任务";
} else {
for (var i = 0; i < data.length; i++) {
message += "<br>找到匹配的数据:" +
"<br>名称:" + data[i].name +
"<br>Token:" + data[i].token +
"<br>ID:" + data[i].id;
}
}
}
layui.use('layer', function() {
var layer = layui.layer;
layer.open({
title: '操作结果',
content: message,
btn: ['确定']
});
});
} else {
layui.use('layer', function() {
var layer = layui.layer;
layer.open({
title: '操作失败',
content: response.message, // 提示返回的错误信息
btn: ['确定']
});
});
}
},
error: function() {
layui.use('layer', function() {
var layer = layui.layer;
layer.open({
title: '请求失败',
content: '请求失败,请检查网络连接或服务器错误。',
btn: ['确定']
});
});
}
});
}
</script>
<style>
body {
font-family: Arial, sans-serif;
background: #f5f5f5;
padding: 20px;
}
.container {
max-width: 800px;
margin: 0 auto;
background: #fff;
padding: 20px;
border-radius: 5px;
}
.task-container {
margin-bottom: 20px;
}
.task-title {
background-color: #009688;
color: #fff;
padding: 10px;
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
border-radius: 5px 5px 0 0;
}
.task-content {
padding: 10px;
border: 1px solid #009688;
border-radius: 0 0 5px 5px;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
font-weight: bold;
margin-bottom: 5px;
}
.form-group .input-field {
width: 100%;
box-sizing: border-box;
padding: 10px;
border: 1px solid #ccc;
border-radius: 3px;
}
.form-group .input-field:focus {
outline: none;
border-color: #009688;
}
.form-group .input-field::placeholder {
color: #999;
}
.form-group .input-field.layui-select {
height: 38px;
}
.form-group .input-field.layui-select .layui-select-title {
height: 36px;
line-height: 36px;
border: none;
background-color: #f5f5f5;
color: #666;
}
.form-group .input-field.layui-select .layui-select-title:hover {
background-color: #fff;
}
.form-group .input-field.layui-select .layui-edge {
top: 14px;
}
.form-group .input-field.layui-select .layui-input {
color: #666;
}
.form-group .input-field.layui-select .layui-input::-webkit-input-placeholder {
color: #999;
}
.form-group .input-field.layui-select .layui-input::-moz-placeholder {
color: #999;
opacity: 1;
}
.form-group .input-field.layui-select .layui-input:-ms-input-placeholder {
color: #999;
}
.form-group .input-field.layui-select .layui-input:-moz-placeholder {
color: #999;
opacity: 1;
}
.form-group .input-field.layui-select .layui-icon {
color: #666;
}
.form-group .input-field.layui-select.layui-form-disabled .layui-select-title {
background-color: #f5f5f5;
color: #c2c2c2;
}
.form-group .input-field.layui-select .layui-edge {
border-left-color: #666;
}
.form-group .input-field.layui-btn {
margin-top: 10px;
}
.info-container {
margin-bottom: 40px;
}
.info-title {
background-color: #009688;
color: #fff;
padding: 10px;
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
border-radius: 5px 5px 0 0;
}
.info-content {
padding: 10px;
border: 1px solid #009688;
border-radius: 0 0 5px 5px;
}
.info-line {
margin-bottom: 10px;
}
.info-line strong {
font-weight: bold;
margin-right: 5px;
}
.info-line a {
color: #009688;
}
.info-image {
max-width: 100%;
height: auto;
margin-bottom: 10px;
}
.api-container {
margin-bottom: 40px;
}
.api-title {
background-color: #009688;
color: #fff;
padding: 10px;
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
border-radius: 5px 5px 0 0;
}
.api-content {
padding: 10px;
border: 1px solid #009688;
border-radius: 0 0 5px 5px;
}
.api-param-table {
width: 100%;
margin-bottom: 10px;
border-collapse: collapse;
}
.api-param-table th,
.api-param-table td {
padding: 8px;
border: 1px solid #ccc;
text-align: left;
}
.api-param-table th {
background-color: #f5f5f5;
font-weight: bold;
}
.api-param-table td {
background-color: #fff;
}
.form-group label {
display: block;
font-weight: bold;
margin-bottom: 5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.form-group .input-field {
width: 100%;
box-sizing: border-box;
padding: 10px;
border: 1px solid #ccc;
border-radius: 3px;
text-align: center;
}
.form-group .input-field.layui-btn {
margin-top: 10px;
line-height: 38px;
text-align: center;
}
.info-line {
margin-bottom: 10px;
word-break: break-all;
}
.api-param-table th,
.api-param-table td {
padding: 8px;
border: 1px solid #ccc;
text-align: center;
}
.task-content {
padding: 10px;
border: 1px solid #009688;
border-radius: 0 0 5px 5px;
text-align: center;
}
.task-content .form-group {
text-align: left;
}
.layui-badge {
display: inline-block;
max-width: 100%;
word-wrap: break-word;
}
</style>
</head>
<body>
<div class="container">
<div class="container">
<div class="task-container">
<div class="task-title">任务操作</div>
<div class="task-content">
<div>
<div class="form-group">
<label for="nameInput">账号:</label>
<input type="text" id="nameInput" lay-verify="required" placeholder="建议QQ号,用于提交和查询任务" autocomplete="off"
class="input-field">
</div>
<div class="form-group">
<label for="tokenInput">Token:</label>
<input type="text" id="tokenInput" lay-verify="required" placeholder="请输入Token" autocomplete="off"
class="input-field">
</div>
<div class="form-group">
<label for="sInput">操作:</label>
<select id="sInput" lay-verify="required" class="layui-select" onchange="handleOperationChange()">
<option value="">请选择操作</option>
<option value="write">提交任务</option>
<option value="read">查询任务</option>
</select>
</div>
<button class="layui-btn layui-btn-normal layui-btn-radius layui-inline-block" onclick="getTokenInfo()">执行操作</button>
</div>
</div>
</div>
<script>
// 将这段代码添加到已有的<script>标签中或者添加一个新的<script>标签
function handleOperationChange() {
var sInput = document.getElementById("sInput");
var tokenInput = document.getElementById("tokenInput");
var tokenInputLabel = document.querySelector("label[for='tokenInput']");
if (sInput.value === "read") {
tokenInput.style.display = "none";
tokenInputLabel.style.display = "none";
} else {
tokenInput.style.display = "block";
tokenInputLabel.style.display = "block";
}
}
</script>
<div class="info-container">
<div class="info-title">阿里refresh_token获取方法</div>
<div class="info-content">
<div class="info-line">
<strong>方法一:扫码获取token</strong>
</div>
<div class="info-line">打开链接<a href="https://alist.nn.ci/zh/guide/drivers/aliyundrive.html">https://alist.nn.ci/zh/guide/drivers/aliyundrive.html</a></div>
<div class="info-line">下滑,有获取token按钮,生成二维码后,截屏使用阿里云盘app扫码,返回网页,即可获取</div>
<br>
<div class="info-line">
<strong>方法二:手动获取</strong>
</div>
<div class="info-line">登录 <a href="https://www.aliyundrive.com/drive/">https://www.aliyundrive.com/drive/</a></div>
<div class="info-line">打开浏览器的开发者工具(如 Chrome DevTools)。</div>
<div class="info-line">然后选择开发者工具的 Console 面板。输入 JSON.parse(localStorage.token).refresh_token,再回车,获取 refresh_token</div>
<img src="https://crossfb-70080.picnjc.qpic.cn/g.52000000-r.e620f/1690787309794_hf_0" alt="方法示意图" class="info-image">
<div class="info-line">
<strong>温馨提示:token有效期大概为1-2个月 ,本程序会自动清理过期的token,每一个账号,只能对应一个token</strong>
</div>
</div>
</div>
<div class="api-container">
<div class="api-title">阿里网盘自动任务接口</div>
<div class="api-content">
<div class="info-line">
<strong>接口地址:</strong>
<span class="api-badge">http://shanhe.kim/api/ali/aliv2.php?name=你的QQ号&token=阿里云盘token&s=write</span>
</div>
</div>
<br>
<div class="info-line">
<strong>请求参数说明:</strong>
</div>
<table class="api-param-table">
<thead>
<tr>
<th>名称</th>
<th>必填</th>
<th>类型</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>是</td>
<td>QQ号,方便查询</td>
</tr>
<tr>
<td>token</td>
<td>是</td>
<td>string</td>
</tr>
<tr>
<td>s</td>
<td>是</td>
<td>选填类型,write为提交任务,read为查询任务</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>
感谢您的来访,获取更多精彩文章请收藏本站。
© 版权声明
THE END
暂无评论内容