人力-測試機-新增自動登入按扭

本機/測試機 新增自動登入按扭

当前为 2022-06-17 提交的版本,查看 最新版本

// ==UserScript==
// @name         人力-測試機-新增自動登入按扭
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  本機/測試機 新增自動登入按扭
// @author       涵德
// @match        http://localhost:30942/Front/Login*
// @match        https://lcahr.lingcheng.tw/TalentMatchBox/Front/Login*
// @match        https://lcahr.lingcheng.tw/TalentMatch/Front/Login*
// @icon         https://www.google.com/s2/favicons?domain=undefined.localhost
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // 在這裡新增你的帳號清單 ['密碼', '帳號', '要顯示的按扭名稱(可省略)']
    const accountList = [
        ['ab1234567890', 'linkchain24'],
        ['ab1234567890', 'a2334521'],
        ['ab1234567890', 'chienwu000002', '* 分協會'],
        ['qaz1234567890', 'chien000001', '* 農機主'],
        ['1234567890qaz', 'chien00000A', '* 農場主/求職者/農機廠商 (小慧農場)'],
        ['ab1234567890', 'claire17', '* 農糧署本署'],
        ['ab1234567890', 'a0953353720', '* 農糧署北區分署'],

        ['0987654321CD', 'CD1234567890', '(正式機)農場主/求職者(CD1234567890)'],
    ];


    // -----------------------------------------------------------------------------------
    $(function() {
        const $passwordInput = $("#Password"); // 密碼 input
        const $accountInput = $("#Account");   // 帳號 input
        const $loginBtn = $(".btn_login");     // 登入按扭
        const $btnContainer = $('<div>', {class: "form-inline position-absolute p-4 justify-content-end d-flex", style: "transform: translateY(-100px); right: 0; width: 70vw"});

        const NewLoginBtn = function([password, account, btnText]) {
            let $newLoginBtn = $("<button>", {
                type: 'button',
                class: 'btn btn-primary form-control m-1',
                title: account + "  |  " + password,
                html: btnText || account,
                'data-toogle': 'tooltip',
            });
            $newLoginBtn.click(() => {
                $accountInput.val(account);
                $passwordInput.val(password);
                $loginBtn.click();
                $.blockUI();
            })
            $btnContainer.append($newLoginBtn);
        }
        accountList.forEach(options => NewLoginBtn(options));
        $(".login__box").prepend($btnContainer);
        $btnContainer.find("[data-toggle='tooltip']").tooltip();
    });
})();

QingJ © 2025

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