添加 'weixin/pay.user.js'

This commit is contained in:
502647092 2021-09-05 12:46:39 +00:00
parent 832c4de243
commit f0c183032a

37
weixin/pay.user.js Normal file
View 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()
})();