preLoadFile.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. window.sendTemp = ''
  2. window.onInterceptedData = function (data) {
  3. window.systemInfo = data
  4. if (data.url.includes('https://mms.pinduoduo.com/desert/mallCsChatStat')) {
  5. const dataTemp = JSON.parse(data.responseBody)
  6. console.log(dataTemp)
  7. let temp = ``
  8. dataTemp.result.csData.forEach(element => {
  9. temp += `${element.csname} mobile:${element.mobile} pc:${element.pc}\r\n`
  10. });
  11. if (temp != window.sendTemp) {
  12. window.sendTemp = temp
  13. sendMessage(window.sendTemp)
  14. }
  15. }
  16. };
  17. function sendMessage (text) {
  18. const myHeaders = new Headers();
  19. myHeaders.append("Content-Type", "application/json");
  20. const raw = JSON.stringify({
  21. "text": text,
  22. "touser": [
  23. "puge"
  24. ]
  25. });
  26. const requestOptions = {
  27. method: "POST",
  28. headers: myHeaders,
  29. body: raw,
  30. redirect: "follow"
  31. };
  32. fetch("https://msg.lamp.run/workWeixin?type=message&corpsecret=KcwQ0WksW0C_yodUQtYQArav5DBKWLnSCkh-5k3_nr8&agentid=1000003&corpID=ww5eabd902d66609f5", requestOptions)
  33. .then((response) => response.text())
  34. .then((result) => console.log(result))
  35. .catch((error) => console.error(error));
  36. }
  37. setInterval(() => {
  38. if(document.querySelector('.update')) document.querySelector('.update').click()
  39. }, 10000);