JZC Auto Login

自动识别验证码登录

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

Advertisement:

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

Advertisement:

// ==UserScript==
// @name         JZC Auto Login
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  自动识别验证码登录
// @author       Sajor

// @match        http://127.0.0.1:3000/user/login*
// @match        http://localhost:3000/user/login*
// @match        http://jz-test.zimeitang.cn/user/login*
// @match        http://jz.zimeitang.cn/user/login*



// @require      https://cdn.bootcdn.net/ajax/libs/jquery/1.4.1/jquery.min.js
// @include      http://47.99.165.231:3000/user/login*
// @include      http://localhost:3000/user/login*
// @grant        none
// ==/UserScript==

(function() {

    function erp_auto(res, auto_code_url) {
        var base64 = res;
        $.ajax({
                url: auto_code_url,
                type: 'POST',
                contentType: 'application/json',
                data: JSON.stringify({
                    "base64": base64,
                    "name": "erp",
                    "threshold": 120,
                    "count": 0
                }), success:function(data) {
                    console.log(data);

                    $(":text")[1].value = data;
                    $(":text")[1].dispatchEvent(new Event('input'));
                    $(":submit").click();
                    // document.images[0].click();
                    //setTimeout(function() {
                    //    $("#submit").click();
                    //},0);
            }
        });
    }


    $(document).ready(function(){
        var auto_code_url = "http://auto.sajor.work/login_base";
        var img = document.images[0];

        // ERP
        $(".login-button").after("<button id='erp_auto' >auto login</button>")
        $("#erp_auto").click(function(){
            var res = document.images[0].currentSrc;
            erp_auto(res, auto_code_url);
            return false;
        });

    });
})();