【详细教程】东大信息化开机自动打卡一条龙

1,398 阅读2分钟

2021/01/27 09:58更新
自动填写表单部分代码有修改
解决位置无法填写成功的问题

-----分割线---------------------------------------------------------

东大信息化自动打卡脚本

具体功能:实现开机自动打卡

浏览器:Chrome

借助插件:Tampermonkey

可在Chrome自带的应用商店搜索添加

image-20210125124008976

第一步:设置开机自动打开打卡网页

打卡网址: http://ehall.seu.edu.cn/qljfwapp2/sys/lwReportEpidemicSeu/*default/index.do#/add

  • 创建快捷方式 右击鼠标 新建->快捷方式
    image-20210125122045030

将上面的网址填入,点击下一步

image-20210125122212420
  • 将快捷方式加入开机自启项目

    打开运行,输入命令:shell:startup

    image-20210125122310426

​ 进入开机自启项目文件夹,把刚刚新建的快捷方式拖进去

image-20210125122448745

这样就完成了开机自动打开这个网址呀。

第二步:自动登录

点击添加新脚本。

image-20210125122817083
// ==UserScript==
// @name         自动登录
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  东大信息化记住密码后自动登录
// @author       You
// @match        https://newids.seu.edu.cn/authserver/login?service=http%3A%2F%2Fehall.seu.edu.cn%2Fqljfwapp2%2Fsys%2FlwReportEpidemicSeu%2F*default%2Findex.do%23%2Fadd
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...

    setTimeout(function(){
         var usr=document.querySelector("#username");
        //你自己的账号
    usr.value="220201234";
    var pwd=document.querySelector("#password");
        //你自己的密码
    pwd.value="sun1234";
        var btn=document.querySelector("#casLoginForm > p:nth-child(5) > button");
    btn.click();},2000);
   

})();

注意:别忘了改代码里的账号和密码
点击ctrl+s保存;

注意

// @match        https://newids.seu.edu.cn/authserver/login?。。。

这一行的地址要匹配

第三步:自动填写表单

点击添加新脚本。

image-20210125122817083
// ==UserScript==
// @name         自动填写提交
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        http://ehall.seu.edu.cn/qljfwapp2/sys/lwReportEpidemicSeu/*default/index.do
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...

   setTimeout(function(){
    
        function random(min, max) {

        return (Math.random() * (max - min) + min).toFixed(1);

    };
          var input=document.querySelector("#app > div > div > div:nth-child(2) > div > div:nth-child(4) > div > div.mint-cell-group-content.mint-hairline--top-bottom.mt-bg-white.mt-bColor-after-grey-lv5 > div:nth-child(1) > div > a > div.mint-cell-wrapper.mt-bColor-grey-lv5.mint-cell-no-bottom-line > div.mint-cell-value.mt-color-grey > input");

    var tem=random(36,37);
     input.value=tem;
      

    var loc=document.querySelector("#app > div > div > div:nth-child(2) > div > div:nth-child(4) > div > div.mint-cell-group-content.mint-hairline--top-bottom.mt-bg-white.mt-bColor-after-grey-lv5 > div:nth-child(64) > div > a > div.mint-cell-wrapper.mt-bColor-grey-lv5.mint-cell-no-bottom-line > div.mint-cell-value.mt-color-grey-lv3");
    //根据地理位置实际情况修改
    loc.innerText="江苏省,宿迁市,沭阳县";


      setTimeout(function(){var btn=document.querySelector("#app > div > div > div.mint-layout-container.OPjctwlgzsl > button");
     btn.click();},1000);
      


    setTimeout(function(){var btn2=document.querySelector("body > div.mint-msgbox-wrapper > div > div.mint-msgbox-btns > button.mint-msgbox-btn.mint-msgbox-confirm.mt-btn-primary");
                         btn2.click();
                         },2000);
   //这里的5000可以根据自己浏览器的响应时间定,我的浏览器大概5秒可以加载完整个页面然后执行这个脚本
   },5000);
   })();

注意:一定要把代码里的地址改掉啊!
点击ctrl+s保存;

第四步:完成

可以点击刚刚创建的网址快捷方式进行测试。

可以每天不限时打卡

每天不限时打卡是因为东大信息化有bug,每天3点过后它只是隐藏了那个增加的按钮,但如果按url访问的话仍然可以找到表单填写页面,提交也没有时间限制,只是不能重复提交而已。