vipexam no ip limit

中科vipexam, umajor, joblib no ip limit

目前為 2025-02-19 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name vipexam no ip limit
  3. // @namespace https://github.com/maiersk
  4. // @version 0.2.5
  5. // @description 中科vipexam, umajor, joblib no ip limit
  6. // @author ABTTEX
  7. // @match http://www.vipexam.net/*
  8. // @match https://www.vipexam.net/*
  9. // @match http://vipexam.net/*
  10. // @match https://vipexam.net/*
  11. // @match http://www.vipexam.org/*
  12. // @match https://www.vipexam.org/*
  13. // @match http://www.vipexam.cn/*
  14. // @match https://www.vipexam.cn/*
  15. // @match http://lib.vipexam.org/*
  16. // @match https://lib.vipexam.org/*
  17. // @match http://lib.vipexam.cn/*
  18. // @match https://lib.vipexam.cn/*
  19. // @match http://vipexam.org/*
  20. // @match https://vipexam.org/*
  21. // @match http://vipexam.cn/*
  22. // @match https://vipexam.cn/*
  23. // @match http://www.umajor.org/*
  24. // @match https://www.umajor.org/*
  25. // @match http://www.umajor.net/*
  26. // @match https://www.umajor.net/*
  27. // @match http://www.joblib.cn/*
  28. // @match https://www.joblib.cn/*
  29. // @require https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js
  30. // @license MIT
  31. // ==/UserScript==
  32.  
  33. (function () {
  34. 'use strict';
  35.  
  36. var _vipexam = null;
  37. var _umajor = null;
  38.  
  39. var _veuser = { code: "", user: { "account": "f46354b31ec64c9c96919e12a9bbd610", "username": "游客(受限)", collegename: "北京大学" } };
  40. var _umuser = { code: "1", user: { "account": "f46354b31ec64c9c96919e12a9bbd610", "username": "游客(受限)", collegename: "1111" } };
  41.  
  42. layui.use(['form', 'layer', 'jquery', 'cookie', 'element'], function () {
  43. var $ = layui.jquery,
  44. element = layui.element,
  45. form = layui.form,
  46. layer = layui.layer,
  47.  
  48. _vipexam = $.cookie("vipexam");
  49. _umajor = $.cookie("umajor");
  50. var vipexam_storage = !!_vipexam ? JSON.parse(_vipexam) : _veuser;
  51. var umajor_storage = _umajor ? JSON.parse(_umajor) : _umuser;
  52. var _vid = vipexam_storage.user.account;
  53. var _umid = umajor_storage.user.account;
  54.  
  55. //vipexam账号角色id,3是教师账号id,4是普通账号id
  56. var _role = 3;
  57.  
  58. function RequestJson(url, params, callback) {
  59. var _idx = layer.load(1);
  60. $.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); } });
  61. }
  62.  
  63. //vipexam登录
  64. form.on('submit(vipexam_crashlogin)', function (data) {
  65. _vid = $("#username").val();
  66.  
  67. RequestJson("user/login.action", { account: $("#username").val(), password: $("#password").val() }, function (data) {
  68. if (data.code == "1") {
  69. data.user.role = _role
  70. $.cookie("vipexam", JSON.stringify(data), { path: '/', expires: 7 });
  71. _vipexam = $.cookie("vipexam");
  72. document.location = "index.html";
  73. } else {
  74. layer.msg(data.msg, { icon: 2 });
  75. }
  76. });
  77. return false;
  78. });
  79.  
  80. // umajor登录
  81. form.on('submit(umajor_crashlogin)', function (data) {
  82. _umid = $("#username").val();
  83.  
  84. RequestJson("user/login.action", { account: $("#username").val(), password: $("#password").val() }, function (data) {
  85. if (data.code == "1") {
  86. $.cookie("umajor", JSON.stringify(data), { path: '/', expires: 7 });
  87. _umajor = $.cookie("umajor");
  88. document.location = "index.html";
  89. } else {
  90. layer.msg(data.msg, { icon: 2 });
  91. }
  92. });
  93. return false;
  94. });
  95.  
  96. // joblib登录
  97. form.on('submit(joblib_crashlogin)', function (data) {
  98. _umid = $("#username").val();
  99.  
  100. RequestJson("user/login.action", { account: $("#username").val(), password: $("#password").val(), Version: "1" }, function (data) {
  101. if (data.code == "1") {
  102. $.cookie("joblib", JSON.stringify(data), { path: '/', expires: 7});
  103. _vipexam = $.cookie("joblib");
  104. window.userName=data.user.account;
  105. document.location = "index.html";
  106. } else {
  107. layer.msg(data.msg, { icon: 2 });
  108. }
  109. });
  110. return false;
  111. });
  112.  
  113. //关闭ip问题弹窗
  114. $(function () {
  115. setTimeout(function () {
  116. layer.closeAll();
  117. }, 350);
  118. });
  119.  
  120. //显示已登录信息
  121. if (_vid != "f46354b31ec64c9c96919e12a9bbd610" || _umid != "f46354b31ec64c9c96919e12a9bbd610") {
  122. if (window.location.host.indexOf('vipexam') !== -1) {
  123. $("#person").text(_vid);
  124. $("#rtbox").hide();
  125. $("#rtbox2").show();
  126. }
  127.  
  128. if (window.location.host.indexOf('umajor') !== -1) {
  129. $("#personid").text(_umid);
  130. $("#login").hide();
  131. $("#person").show();
  132. $("#personid").hover(function () {
  133. layer.tips("<a href='personal_center.html' style='color:#fff;'>个人中心</a>", this, { tips: [3, '#666'], time: 3000, area: ['80px', '40px'] });
  134. }, function () { });
  135. }
  136.  
  137. if (window.location.host.indexOf('joblib') !== -1) {
  138. $(".jl_logo").prepend("<img src='"+data.collegeLogo+"?v="+_version+"' style='float:left;margin:10px 10px 10px 0;max-width:250px;' alt/>");
  139. $(".jl_search").removeClass("logo_hide").addClass("logo_show");
  140. }
  141. }
  142. });
  143.  
  144. $(document).ready(function () {
  145. if (window.location.host.indexOf('vipexam') !== -1) {
  146. var div = $(".layui-form-item-center");
  147. var vipexam_crashlogin = '<div id="vipexam_crashlogin" lay-submit lay-filter="vipexam_crashlogin" class="layui-btn" >crashlogin</div>';
  148. div.append(vipexam_crashlogin);
  149. }
  150.  
  151. if (window.location.host.indexOf('umajor') !== -1 && window.location.pathname.indexOf('login') !== -1) {
  152. var umajor_crashlogin = '<div id="umajor_crashlogin" lay-submit lay-filter="umajor_crashlogin" class="layui-btn" >crashlogin</div>';
  153. $(".layui-form").append(umajor_crashlogin);
  154. }
  155. if (window.location.host.indexOf('joblib') !== -1 && window.location.pathname.indexOf('login') !== -1) {
  156. var joblib_crashlogin = '<div id="joblib_crashlogin" lay-submit lay-filter="joblib_crashlogin" class="layui-btn" >crashlogin</div>';
  157. $(".layui-form").append(joblib_crashlogin);
  158. }
  159.  
  160. })
  161. })();