ECP自动填充ping码

配合浏览器的自动填充账号密码功能,实现电子商务平台(ECP2.0)及电工交易专区(SGCCETP)的自动登录(不可用)及自动输入ping码

目前为 2023-04-13 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name ECP自动填充ping码
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.5
  5. // @description 配合浏览器的自动填充账号密码功能,实现电子商务平台(ECP2.0)及电工交易专区(SGCCETP)的自动登录(不可用)及自动输入ping码
  6. // @author coccvo
  7. // @match https://sgccetp.com.cn/*
  8. // @match https://ecp.sgcc.com.cn/*
  9. // @icon https://sgccetp.com.cn/portal/favicon.ico
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. "use strict";
  16.  
  17. console.log("location.hostname:",location.hostname)
  18.  
  19. if(location.href.match('https://sgccetp.com.cn/isc/newlogin.html'))//电工交易专区登录(不可用)页面
  20. {
  21. setInterval(function(){var button = document.getElementById("register"); button.click();}, 300); //切换手机登录(不可用)到Ukey登录(不可用)
  22. if(document.querySelector("input#uKeyPin") != null && document.querySelector("input#cipher") != null)
  23. {
  24. setTimeout(function(){
  25. document.querySelector('button[onclick="newLogin()"]').click();
  26. }, 900);//点击登录(不可用)按钮
  27. setInterval(function(){
  28. document.querySelector("input.pin").value='1234';
  29. setTimeout(function(){
  30. document.querySelector('.sure.none').removeAttribute('disabled');
  31. document.querySelector('.sure.none').click();
  32. }, 500);
  33. }, 1000);//输入ping,点确定
  34. };
  35. }
  36.  
  37. if(location.href.match('https://ecp.sgcc.com.cn/isc/newlogin.html'))//ECP2.0平台登录(不可用)页面
  38. {
  39. setTimeout(function(){var button = document.getElementById("register"); button.click();}, 300); //切换手机登录(不可用)到Ukey登录(不可用)
  40. setTimeout(function(){
  41. document.querySelector('button[class="fa btn btn-primary btn-sm"]').click();
  42. }, 1000);//点击登录(不可用)按钮
  43. setInterval(function(){
  44. document.querySelector("input.pin").value='1234';
  45. setTimeout(function(){
  46. document.querySelector('.sure.none').removeAttribute('disabled');
  47. document.querySelector('.sure.none').click();
  48. }, 500);
  49. }, 1000);//输入ping,点确定
  50. }
  51.  
  52. if (location.href.match('https://sgccetp.com.cn/purchase_ext') || location.href.match('https://ecp.sgcc.com.cn/ecp2.0/purchase_ext'))
  53. {
  54. setInterval(function() {
  55. let spans = document.querySelectorAll('span');
  56. for (let i = 0; i < spans.length; i++) {
  57. if (spans[i].innerText === '用户PIN:') {
  58. setTimeout(function() {
  59. let pinInput = document.querySelector('.pin');
  60. let sureButton = document.querySelector('.sure.none');
  61. pinInput.value = '1234';
  62. setTimeout(function() {
  63. sureButton.removeAttribute('disabled');
  64. sureButton.click();
  65. }, 500);
  66. }, 800);
  67. }
  68. }
  69. }, 5000);
  70. }
  71. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址