vipexam no ip limit

中科vipexam no ip limit

当前为 2019-12-05 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name vipexam no ip limit
  3. // @namespace https://github.com/maiersk
  4. // @version 0.1
  5. // @description 中科vipexam no ip limit
  6. // @author ABTTEX
  7. // @match http://lib.vipexam.org/*
  8. // @require https://code.jquery.com/jquery-3.4.1.min.js
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var _vipexam = null;
  15.  
  16. layui.use(['form','layer','jquery','cookie'], function(){
  17. var $ = layui.jquery,
  18. form = layui.form,
  19. layer = layui.layer,
  20. cookie = layui.cookie;
  21.  
  22. _vipexam = $.cookie("vipexam");
  23. var _storage = !!_vipexam ? JSON.parse(_vipexam) : _veuser;
  24. var _vid = _storage.user.account;
  25.  
  26. function RequestJson(url, params, callback) {
  27. var _idx = layer.load(1);
  28. $.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);} });
  29. }
  30.  
  31. //代替原有登录(不可用)function
  32. form.on('submit(crashlogin)', function(data){
  33. _vid = $("#username").val();
  34. //ipValidates();
  35. RequestJson("user/login.action",{account:$("#username").val(),password:$("#password").val()},function(data){
  36. if(data.code == "1"){
  37. //if(_flag){
  38. //alert(JSON.stringify(data))
  39. $.cookie("vipexam", JSON.stringify(data), { path: '/', expires: 7});
  40. _vipexam = $.cookie("vipexam");
  41. document.location = "index.html";
  42. //}else{
  43. // layer.msg("抱歉!IP:"+_ip+" 不在系统授权范围内!",{icon:2});
  44. //}
  45. }else{
  46. layer.msg(data.msg,{icon:2});
  47. }
  48. });
  49. return false;
  50. });
  51.  
  52. //关闭ip问题弹窗
  53. $(function(){
  54. setTimeout(function () {
  55. layer.closeAll();
  56. }, 350);
  57. });
  58.  
  59. //显示已登录(不可用)信息
  60. if(_vid != "f46354b31ec64c9c96919e12a9bbd610"){
  61. $("#person").text(_vid);
  62. $("#rtbox").hide();
  63. $("#rtbox2").show();
  64. }
  65. });
  66.  
  67. $(document).ready(function() {
  68.  
  69. var div = $(".layui-form-item-center")
  70. var buthtml = '<input type="button" id="crashlogin" lay-submit lay-filter="crashlogin" value="crashlogin" />';
  71. //var buthtml = '<input type="button" id="crashlogin" value="crashlogin" />';
  72. div.append(buthtml);
  73.  
  74. // var but = $("#crashlogin")
  75.  
  76. // _vipexam = ""
  77.  
  78. // but.click(function(){
  79. // alert(JSON.stringify({account:$("#username").val(),password:$("#password").val()}))
  80. // $.ajax({
  81. // type: "post",
  82. // data: {account:$("#username").val(),password:$("#password").val()},
  83. // url: "user/login.action",
  84. // dataType: "json",
  85. // global: false,
  86. // success: function (data) {
  87. // if(data.code == "1"){
  88.  
  89. // alert(JSON.stringify(data))
  90. // $.cookie("vipexam", JSON.stringify(data), { path: '/', expires: 7});
  91. // _vipexam = $.cookie("vipexam");
  92. // document.location = "index.html";
  93.  
  94.  
  95. // }else{
  96. // layer.msg(data.msg,{icon:2});
  97. // }
  98. // },
  99. // complete: function () { },
  100. // error:function (XMLHttpRequest, textStatus, errorThrown){ }
  101. // });
  102. // })
  103.  
  104. })
  105.  
  106. })();

QingJ © 2025

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