Greasy Fork

Greasy Fork is available in English.

天职大校园网自动登陆工具

实现天职大校园网自动登陆。

当前为 2021-11-18 提交的版本,查看 最新版本

// ==UserScript==
// @name         天职大校园网自动登陆工具
// @version      1.0.1
// @description  实现天职大校园网自动登陆。
// @author       Interpret
// @match        *://172.21.36.1/*
// @grant        none
// @namespace    tjtclogin
// @license      MIT
// @run-at       document-end
// @grant        unsafeWindow
// @grant        GM_xmlhttpRequest
// @grant        GM_setClipboard
// ==/UserScript==

(function (){
    'use strict';
    //用户自定义
    var user="学号"
    var pwd="密码"
    var yys="1" //1为登录电信互联网,0为登录职大校园网。
    var run="0" //1为启用自动登陆,0为不启用只填写账号密码。


    //代码部分,如不了解请勿随意修改!
    window.onload = function() {
        if(document.title=="上网登录页") {
            document.getElementsByClassName("edit_lobo_cell")[1].value=user
            document.getElementsByClassName("edit_lobo_cell")[2].value=pwd
            if (yys==1) {
                document.getElementsByClassName("edit_lobo_cell")[5].value="@tjtc"
            } else {
                document.getElementsByClassName("edit_lobo_cell")[5].value=""
            }
            if (run==1) {
                setTimeout("document.getElementsByClassName('edit_lobo_cell')[0].click()", 5000)
            }
        }
        if(document.getElementsByClassName("edit_lobo_cell")[1].value=="注  销"||document.getElementsByClassName("edit_lobo_cell")[1].value=="返  回") {
            alert('校园网已登录,如需要注销,请在注销前关闭本插件,否则还会执行自动登录操作');
            var tip1=document.getElementsByClassName("edit_cell edit_hyperlink")[0];
            tip1.style="top: 179px; left: 175px; width: auto; height: 40px; color: rgb(255,0,0); background-color: rgba(0, 0, 0, 0); font-size: 15px; right: auto; bottom: auto;";
            tip1.lastElementChild.outerHTML='<a href="http://greasyfork.icu/zh-CN/scripts/435690-%E5%A4%A9%E8%81%8C%E5%A4%A7%E6%A0%A1%E5%9B%AD%E7%BD%91%E8%87%AA%E5%8A%A8%E7%99%BB%E9%99%86%E5%B7%A5%E5%85%B7" target="_blank"><p>使用说明点击这里☜<br><br></p></a>';
        }
    }
})();