mirror of
https://gitee.com/technical-laohu/mpay.git
synced 2025-09-17 09:16:40 +08:00
文档更新
This commit is contained in:
parent
8f1d6ce013
commit
6c3106a6aa
@ -22,9 +22,9 @@ const logins = [
|
||||
function extractLoginInfo(request, logins) {
|
||||
logins.forEach((login) => {
|
||||
const urlObj = isHttp(request.url, login.host);
|
||||
if (login.host.toLowerCase() === urlObj.hostname.toLowerCase()
|
||||
&& login.orderQuery.toLowerCase() === urlObj.pathname.toLowerCase()
|
||||
&& login.method.toLowerCase() === request.method.toLowerCase()) {
|
||||
if (login.host.toLowerCase() === urlObj.hostname.toLowerCase() &&
|
||||
login.orderQuery.toLowerCase() === urlObj.pathname.toLowerCase() &&
|
||||
login.method.toLowerCase() === request.method.toLowerCase()) {
|
||||
const jsonData = JSON.parse(request.request);
|
||||
const acc = eval(`jsonData.${login.accPath}`);
|
||||
const psw = eval(`jsonData.${login.pswPath}`);
|
||||
@ -32,13 +32,12 @@ function extractLoginInfo(request, logins) {
|
||||
'账号': acc,
|
||||
'密码': psw
|
||||
};
|
||||
console.log('-----' + login.name + '-----');
|
||||
console.log('----- ' + login.name + ' -----');
|
||||
console.table(data);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 检查网址是否为http或https开头的字符串
|
||||
function isHttp(url, host) {
|
||||
if (url.startsWith('http') || url.startsWith('https')) {
|
||||
return new URL(url);
|
||||
@ -47,8 +46,6 @@ function isHttp(url, host) {
|
||||
return new URL(url);
|
||||
}
|
||||
}
|
||||
|
||||
// XHR 重写
|
||||
var oldOpen = XMLHttpRequest.prototype.open;
|
||||
var oldSend = XMLHttpRequest.prototype.send;
|
||||
XMLHttpRequest.prototype.open = function (method, url) {
|
||||
@ -62,21 +59,19 @@ XMLHttpRequest.prototype.send = function (body) {
|
||||
url: this._url,
|
||||
method: this._method,
|
||||
request: this._body
|
||||
}
|
||||
};
|
||||
extractLoginInfo(res, logins);
|
||||
return oldSend.apply(this, arguments);
|
||||
};
|
||||
|
||||
// fetch 重写
|
||||
window.au_fetch = window.fetch;
|
||||
window.fetch = function (url, options) {
|
||||
const res = {
|
||||
url: url,
|
||||
method: options.method,
|
||||
request: options.body
|
||||
}
|
||||
};
|
||||
extractLoginInfo(res, logins);
|
||||
return window.au_fetch.apply(window, [url, options]).then((response) => {
|
||||
return response;
|
||||
});
|
||||
})
|
||||
};
|
@ -46,6 +46,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-container">
|
||||
<div class="layui-text">
|
||||
<p>部分平台的账户密码填写比较特殊,<strong><a href="https://f0bmwzqjtq2.feishu.cn/docx/HBVrdrsACo36bzxUCSPcjOBNnyb?from=from_copylink" target="_blank"><strong>请查看文档</strong></a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div class="button-container">
|
||||
|
Loading…
Reference in New Issue
Block a user