-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
269 lines (248 loc) · 12.3 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<!DOCTYPE html>
<html>
<head>
<!-- 网站说明 -->
<meta charset="utf-8">
<link rel="shortcut icon" href="/source/images/favicon.ico">
<meta name="keywords" contect="valorant,瓦洛兰特,Python,Api">
<meta name="description" contect="在线查询valorant每日商店">
<meta name="author" contect="慕雪">
<title>瓦洛兰特商店查询</title>
<!-- 51la 统计 -->
<script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
<script>LA.init({ id: "JxtoCdk3eWo0ongd", ck: "JxtoCdk3eWo0ongd" })</script>
<!-- main -->
<script>
// 获取系统当前时间的函数
function gettime() {
var a = new Date();
var b = a.toLocaleTimeString();
var c = a.toLocaleDateString();
document.getElementById("currenttime").innerHTML = "现在是 " + c + " " + b + ",欢迎光临!";
}
// setInterval(function () { gettime() }, 1000);
// 字符串是否为空
function isEmptyStr(s) {
if (s == undefined || s == null || s == '') {
return true
}
return false
}
var responsecontent;// 全局返回的结果
var api_token = "59a05fbc-9281-11ed-a2f5-525400c9274f" // 全局可用的token
// 发送HTTP请求的函数,登录接口
function SendXMLHttpRequestImg() {
var act = document.getElementById("account").value;
var pwd = document.getElementById("passwd").value;
var bgimg = document.getElementById("img_url").value;
var bgsz = document.getElementById("img_ratio").value;
if (!isEmptyStr(act) && !isEmptyStr(pwd)) {
window.alert("开始请求,请耐心等待(约10s返回结果)");
// 点击了登录按钮后,邮箱验证按钮才会亮起
document.getElementById("vcode-btn").disabled = false;
// 开始请求
var xmlhttp, url = "https://val.musnow.top/api/shop-url";
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();// IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
}
else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");// IE6, IE5 浏览器执行代码
}
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
responsecontent = xmlhttp.responseText;
var Res = "Api已返回结果,拳头用户 " + act + " \n" + responsecontent;
document.getElementById("result").innerText = Res;
document.getElementById("imgjump").disabled = false;//取消对imgjump按钮的禁用
console.log(responsecontent);
window.alert("请求成功!");
}
}
// 利用post在正文发送请求,而不是url中
var sendData = {"token":api_token,"account":act,"passwd":pwd,"img_src":bgimg,"img_ratio":bgsz};
//将用户输入值序列化成json字符串,并请求api
xmlhttp.setRequestHeader('content-type', 'application/json');
xmlhttp.open("POST", url, true);
xmlhttp.send(JSON.stringify(sendData));
} else {
window.alert("请输入参数!");
document.getElementById("result").innerText = "";
document.getElementById("imgjump").disabled = true;
responsecontent = "";
}
}
//发送HTTP请求的函数,请求2fa接口
function SendXMLHttpRequestTfa() {
var act = document.getElementById("account").value;//账户
var vcode = document.getElementById("vcode").value;//邮箱验证吗
if (!isEmptyStr(act) && !isEmptyStr(vcode)) {
window.alert("您的邮箱验证码已发送");
var xmlhttp, url = "https://val.musnow.top/api/tfa";
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();// IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
}
else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");// IE6, IE5 浏览器执行代码
}
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
responsecontent = xmlhttp.responseText;
console.log(responsecontent);
var res = JSON.parse(responsecontent, null, 3);
if (res['code'] == 0) {
window.alert("邮箱验证码接收成功,请等待商店结果返回");
}
else {
window.alert("邮箱验证码接收失败,请重新操作");
document.getElementById("result").innerText = responsecontent;
}
document.getElementById("vcode-btn").disabled = true;// 恢复禁用邮箱验证按钮
}
}
var sendData = {"token":api_token,"account":act,"vcode":vcode};
//将用户输入值序列化成json字符串,并请求api
xmlhttp.setRequestHeader('content-type', 'application/json');
xmlhttp.open("POST", url, true);
xmlhttp.send(JSON.stringify(sendData));
} else {
window.alert("请输入Riot账户和6位邮箱验证码!");
document.getElementById("result").innerText = "";
document.getElementById("imgjump").disabled = true;
document.getElementById("vcode-btn").disabled = true;
responsecontent = "";
}
}
// 跳转到图片页面
function Jump() {
var res = JSON.parse(responsecontent, null, 3);
var res_url = res['message'];
console.log(res_url);
if (res_url.includes("http")) {
// 返回一个不受限制的路径
// var img_url = res_url.replace(/(https?:\/\/)/, 'https://images.weserv.nl/?url=$1');
// console.log(img_url);
// window.location.href = res_url;
window.open(res_url);
document.getElementById("jumpinfo").innerText = "若点击此按钮无反应,可手动复制上方图片url到浏览器中访问";
}
}
</script>
<style>
pre {
background-color: rgb(238, 231, 231);
outline: 1px solid #ccc;
padding: 5px;
margin: 5px;
}
.string {
color: rgb(101, 93, 186);
}
.number {
color: rgb(13, 214, 124);
}
.boolean {
color: rgb(225, 97, 195);
}
.null {
color: rgb(241, 238, 150);
}
.key {
color: #cf4914;
}
html,
body {
height: 100%;
}
#container {
/*保证footer是相对于container位置绝对定位*/
position: relative;
width: 100%;
min-height: 100%;
/*设置padding-bottom值大于等于footer的height值,以保证main的内容能够全部显示出来而不被footer遮盖;*/
padding-bottom: 50px;
box-sizing: border-box;
left: 6px;
}
header {
width: 100%;
height: 50px;
}
.main {
width: 100%;
height: 200px;
}
footer {
width: 100%;
height: 50px;
/* footer的高度一定要是固定值*/
position: fixed;
bottom: 10px;
left: 0px;
color: #ffffff;
font-size: 12px;
text-align: center;
}
#api-docs {
color: #ffffff;
}
</style>
<!-- 将空referrer设置添加到最后面,加载完统计代码再加载空refer -->
<meta name="referrer" content="no-referrer">
</head>
<!-- link点击前 alink点击时 vlink点击后 的颜色-->
<body link="#98F5FF" alink="#8EE5EE" vlink="#76EEC6" background="/source/images/background.png">
<div id="container">
<header>
<h3 style="color:#f9dceb">瓦洛兰特商店查询 by 慕雪</h3>
</header>
<div id="main">
<!-- <div id="time-text">
<label id="currenttime" style="color: #a5f6ff; "></label>
</div> -->
<div id="api-docs">
<img src="https://img.shields.io/badge/Python-3.8%2B-green" alt="python"> <img
src="https://img.shields.io/github/last-commit/musnows/Kook-Valorant-Bot" alt="last-commit"> <img
src="https://img.shields.io/github/v/release/musnows/Kook-Valorant-Bot" alt="release"> <a
href="https://kook.top/gpbTwZ" target="_blank"><img
src="https://www.kaiheila.cn/api/v3/badge/guild?guild_id=3986996654014459&style=0"
alt="kook"></a> <a href="https://github.com/musnows/Kook-Valorant-Bot" target="_blank"><img
src="https://img.shields.io/github/stars/musnows/Kook-Valorant-Bot?style=social"
alt="github stars"></a><br><br>
<a href="https://gitee.com/musnow/Kook-Valorant-Bot" target="_blank">
<img
src="https://gitee.com/musnow/Kook-Valorant-Bot/widgets/widget_card.svg?colors=4183c4,ffffff,ffffff,e3e9ed,666666,9b9b9b">
</a>
<p>本Api基于 Python aiohttp 库,同 Kook-Valorant-Bot 共享画图处理模块;<br>
本Api代码已开源,后台不会打印/保存您的账户密码,可放心食用👻</p>
<p>邮箱2fa验证接口和更多信息,请查看 <a
href="https://gitee.com/musnow/Kook-Valorant-Bot/blob/develop/docs/valorant-shop-img-api.md"
target="_blank">
Api-Docs
</a>📕<br>接口速率限制为10次/分,请勿多次点击,以免影响其他用户</p>
</div>
<div id="api-button">
<form style="color:#e4e4e4fa;border:2px">
<label> 请输入您的拳头账户 </label><input type="text" value="" id="account" /><br>
<label> 请输入您的账户密码 </label><input type="password" value="" id="passwd" /><br>
<label> 自定义背景图url(可选参数,支持16-9/1-1图片)</label><input type="text" value="" id="img_url" /> <a
href="https://img.musnow.top/" target="_blank"> 图片url获取</a><br>
<label> 自定义背景图比例(可选参数,若为1-1的图片则填1)</label><input type="text" value="0" id="img_ratio" /><br>
<label> 若您开启了邮箱验证,请先点击左侧按钮发送登录请求 </label><input type="text" value="在此处填写验证码" id="vcode" /><br>
</form>
<button type="button" onclick="SendXMLHttpRequestImg()">填好信息了,走你!</button> <button type="button"
disabled="true" onclick="SendXMLHttpRequestTfa()" id="vcode-btn">邮箱验证</button>
<p id="result" style="color:#f6eb8bfa"></p>
<button type="button" disabled="true" onclick="Jump()" id="imgjump">点我跳转图片</button>
<p id="jumpinfo" style="color:#ffffff; font-size:15px;"></p>
</div>
</div>
<footer>
<p><a href="https://val1.musnow.top/">备用站点</a> | Copyright©2023 慕雪 | <a
href="https://gitee.com/musnow/Kook-Valorant-Bot/tree/develop/web" target="_blank">SourceCode</a>
</p>
<script id="LA-DATA-WIDGET" crossorigin="anonymous" charset="UTF-8"
src="https://v6-widget.51.la/v6/JxtoCdk3eWo0ongd/quote.js?theme=#1690FF,#F2F2F2,#F1F1F1,#CDCDCD,#FFFFFF,#1690FF,12&f=12"></script>
</footer>
</div>
</body>
</html>