添加 'weixin/pay.user.js'
This commit is contained in:
parent
832c4de243
commit
f0c183032a
37
weixin/pay.user.js
Normal file
37
weixin/pay.user.js
Normal file
@ -0,0 +1,37 @@
|
||||
// ==UserScript==
|
||||
// @name 微信商户登录通知
|
||||
// @namespace https://miaowoo.cc/
|
||||
// @version 0.1
|
||||
// @description 自动化登录通知
|
||||
// @author MiaoWoo
|
||||
// @match https://pay.weixin.qq.com/index.php/core/home/login**
|
||||
// @grant none
|
||||
// ==/UserScript==
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
async function sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms))
|
||||
}
|
||||
async function post(url, data) {
|
||||
return await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(data)
|
||||
}).then(r => r.json())
|
||||
}
|
||||
async function main() {
|
||||
let qrcode = null
|
||||
while (!(qrcode = document.getElementById('IDQrcodeImg'))) {
|
||||
await sleep(100)
|
||||
}
|
||||
let url = null
|
||||
while (!(url = qrcode.getAttribute('title'))) {
|
||||
await sleep(100)
|
||||
}
|
||||
await post('https://oauthtest.yumc.pw/qr/wxpay', {url})
|
||||
}
|
||||
main()
|
||||
})();
|
Loading…
Reference in New Issue
Block a user