vipexam no ip limit

中科vipexam no ip limit

目前為 2019-12-06 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         vipexam no ip limit
// @namespace    https://github.com/maiersk
// @version      0.1.1
// @description  中科vipexam no ip limit
// @author       ABTTEX
// @match        http://www.vipexam.org/*
// @match        http://www.vipexam.cn/*
// @match        http://lib.vipexam.org/*
// @match        http://lib.vipexam.cn/*
// @match        http://vipexam.org/*
// @match        http://vipexam.cn/*
// @require      https://code.jquery.com/jquery-3.4.1.min.js
// ==/UserScript==

(function() {
    'use strict';

    var _vipexam = null;

    layui.use(['form','layer','jquery','cookie'], function(){
        var $ = layui.jquery,
            form = layui.form,
            layer = layui.layer,
            cookie = layui.cookie;

        _vipexam = $.cookie("vipexam");
        var _storage = !!_vipexam ? JSON.parse(_vipexam) : _veuser;
        var _vid = _storage.user.account;

        function RequestJson(url, params, callback) {
            var _idx = layer.load(1);
            $.ajax({ type: "post", data: params, url: url, dataType: "json", global: false, success: function (data) { callback && callback(data); }, complete: function () { layer.close(_idx); },error:function (XMLHttpRequest, textStatus, errorThrown){layer.close(_idx);} });
        }

        //代替原有登录function
        form.on('submit(crashlogin)', function(data){
            _vid = $("#username").val();
            //ipValidates();
            RequestJson("user/login.action",{account:$("#username").val(),password:$("#password").val()},function(data){
                if(data.code == "1"){
                    //if(_flag){
                        //alert(JSON.stringify(data))
                        $.cookie("vipexam", JSON.stringify(data), {  path: '/', expires: 7});
                        _vipexam = $.cookie("vipexam");
                        document.location = "index.html";
                    //}else{
                    //    layer.msg("抱歉!IP:"+_ip+" 不在系统授权范围内!",{icon:2});
                    //}
                }else{
                    layer.msg(data.msg,{icon:2});
                }
            });
            return false;
        });

        //关闭ip问题弹窗
        $(function(){
            setTimeout(function () {
                layer.closeAll();
            }, 350);
        });

        //显示已登录信息
        if(_vid != "f46354b31ec64c9c96919e12a9bbd610"){
            $("#person").text(_vid);
            $("#rtbox").hide();
            $("#rtbox2").show();
        }
    });

    $(document).ready(function() {

        var div = $(".layui-form-item-center")
        var buthtml = '<input type="button" id="crashlogin" lay-submit lay-filter="crashlogin" value="crashlogin" />';
        //var buthtml = '<input type="button" id="crashlogin" value="crashlogin" />';
        div.append(buthtml);

        // var but = $("#crashlogin")

        // _vipexam = ""

        // but.click(function(){
        //     alert(JSON.stringify({account:$("#username").val(),password:$("#password").val()}))
        //     $.ajax({
        //         type: "post",
        //         data: {account:$("#username").val(),password:$("#password").val()},
        //         url: "user/login.action",
        //         dataType: "json",
        //         global: false,
        //         success: function (data) {
        //             if(data.code == "1"){

        //                 alert(JSON.stringify(data))
        //                 $.cookie("vipexam", JSON.stringify(data), {  path: '/', expires: 7});
        //                 _vipexam = $.cookie("vipexam");
        //                 document.location = "index.html";


        //             }else{
        //                 layer.msg(data.msg,{icon:2});
        //             }
        //         },
        //         complete: function () {   },
        //         error:function (XMLHttpRequest, textStatus, errorThrown){ }
        //     });
        // })

    })

})();