Skip to content

Commit

Permalink
更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Wscats committed Nov 5, 2019
1 parent 69fa698 commit ac4ed4a
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 21 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Installation

- []()
- [Get the Chrome Extension]()

101 changes: 100 additions & 1 deletion dist/bundle.js
Original file line number Diff line number Diff line change
@@ -1 +1,100 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";function r(e,t,n,r,o,c,u){try{var a=e[c](u),i=a.value}catch(e){return void n(e)}a.done?t(i):Promise.resolve(i).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise(function(o,c){var u=e.apply(t,n);function a(e){r(u,o,c,a,i,"next",e)}function i(e){r(u,o,c,a,i,"throw",e)}a(void 0)})}}var c=n(1),u=c.GetRequest,a=c.ajax,i={commit:["666"]},l="http://stu.1000phone.net",s=location.href.indexOf("?")?location.href.split("?")[0]:location.href,d=new Object;d=u();var f=function(){var e=o(regeneratorRuntime.mark(function e(){var t,n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(t=0,n=document.querySelectorAll("input");t<n.length;)document.querySelectorAll("input")[t].click(),t+=4;return e.next=5,a("GET","https://wscats.github.io/angular-tutorial/control/core.json");case 5:r=e.sent,console.log(r),i.commit=i.commit.concat(r.commit),document.querySelectorAll("textarea")[0].value=i.commit[Math.floor(Math.random()*i.commit.length)],document.querySelectorAll("textarea")[1].value=i.commit[Math.floor(Math.random()*i.commit.length)],document.getElementById("addstudent").click();case 11:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();switch(s){case"".concat(l,"/student.php/Public/login"):var m=d.u,p=d.p;console.log(m,p),document.querySelector("[name='Account']").value=m,document.querySelector("[name='PassWord']").value=p,setTimeout(function(){document.querySelector("[type='submit']").click()},500);break;case"".concat(l,"/student.php/index/index"):location.href="".concat(l,"/student.php/Index/evaluate?autocommit=1");case"".concat(l,"/student.php/Index/index"):location.href="".concat(l,"/student.php/Index/evaluate?autocommit=1");case"".concat(l,"/student.php/Index/evaluate"):d.autocommit&&setTimeout(function(){document.querySelector("[class='btn btn-xs btn-success']").click()});break;case"".concat(l,"/student.php/Index/start_evaluate"):case"".concat(l,"/student.php/index/start_evaluate"):f()}if(location.href.indexOf("inquiry/index")>=0){for(var h=document.querySelectorAll('[data-score="5.00"]'),v=0;v<h.length;v++)h[v].click();for(var y=document.querySelectorAll('[type="checkbox"]'),b=0;b<y.length;b++)y[b].click();o(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a("GET","https://wscats.github.io/angular-tutorial/control/core.json");case 2:t=e.sent,console.log(t),i.commit=i.commit.concat(t.commit),document.querySelector("textarea").value=i.commit[Math.floor(Math.random()*i.commit.length)],document.querySelector("#submit_btn").click();case 7:case"end":return e.stop()}},e)}))()}},function(e,t,n){"use strict";(function(e){e.export={GetRequest:function(){var e=location.search,t=new Object;if(-1!=e.indexOf("?")){var n=e.substr(1);strs=n.split("&");for(var r=0;r<strs.length;r++)t[strs[r].split("=")[0]]=unescape(strs[r].split("=")[1])}return t}}}).call(this,n(2)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}}]);
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./src/index.js");
/******/ })
/************************************************************************/
/******/ ({

/***/ "./src/index.js":
/*!**********************!*\
!*** ./src/index.js ***!
\**********************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("//http://stu.1000phone.net/student.php/Public/login\r\n\r\nconst GetRequest = () => {\r\n //获取url中\"?\"符后的字串\r\n var url = location.search;\r\n var theRequest = new Object();\r\n if (url.indexOf(\"?\") != -1) {\r\n var str = url.substr(1);\r\n strs = str.split(\"&\");\r\n for (var i = 0; i < strs.length; i++) {\r\n theRequest[strs[i].split(\"=\")[0]] = unescape(strs[i].split(\"=\")[1]);\r\n }\r\n }\r\n return theRequest;\r\n}\r\n\r\nconst ajax = (type, url) => {\r\n new Promise((resolve, reject) => {\r\n let xhr = new XMLHttpRequest();\r\n xhr.open(type, url, true);\r\n xhr.onreadystatechange = function () {\r\n if (xhr.readyState == 4) {\r\n resolve(JSON.parse(xhr.responseText))\r\n } else {\r\n reject(xhr.responseText)\r\n }\r\n }\r\n xhr.send();\r\n })\r\n}\r\n\r\nlet stu = {\r\n\tcommit: [\"666\"]\r\n}\r\nlet host = \"http://stu.1000phone.net\";\r\nlet href = location.href.indexOf(\"?\") ? location.href.split(\"?\")[0] : location.href;\r\nlet Request = new Object();\r\nRequest = GetRequest();\r\n\r\nconst score = async () => {\r\n\tlet i = 0;\r\n\tlet inputs = document.querySelectorAll(\"input\");\r\n\tfor (; i < inputs.length;) {\r\n\t\tdocument.querySelectorAll(\"input\")[i].click();\r\n\t\ti += 4;\r\n\t}\r\n\tlet data = await ajax(\"GET\", \"https://wscats.github.io/angular-tutorial/control/core.json\");\r\n\tconsole.log(data);\r\n\tstu.commit = stu.commit.concat(data.commit);\r\n\tdocument.querySelectorAll(\"textarea\")[0].value = stu.commit[Math.floor(Math.random() * stu.commit.length)];\r\n\tdocument.querySelectorAll(\"textarea\")[1].value = stu.commit[Math.floor(Math.random() * stu.commit.length)];\r\n\tdocument.getElementById(\"addstudent\").click();\r\n}\r\n\r\nswitch (href) {\r\n\tcase `${host}/student.php/Public/login`:\r\n\t\tlet u = Request[\"u\"];\r\n\t\tlet p = Request[\"p\"];\r\n\t\tconsole.log(u, p);\r\n\t\tdocument.querySelector(\"[name='Account']\").value = u;\r\n\t\tdocument.querySelector(\"[name='PassWord']\").value = p;\r\n\t\tsetTimeout(() => {\r\n\t\t\tdocument.querySelector(\"[type='submit']\").click();\r\n\t\t}, 500);\r\n\t\tbreak;\r\n\tcase `${host}/student.php/index/index`:\r\n\t\tlocation.href = `${host}/student.php/Index/evaluate?autocommit=1`;\r\n\tcase `${host}/student.php/Index/index`:\r\n\t\tlocation.href = `${host}/student.php/Index/evaluate?autocommit=1`;\r\n\tcase `${host}/student.php/Index/evaluate`:\r\n\t\tlet autocommit = Request[\"autocommit\"];\r\n\t\tif (autocommit) {\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tdocument.querySelector(\"[class='btn btn-xs btn-success']\").click();\r\n\t\t\t})\r\n\t\t}\r\n\t\tbreak;\r\n\tcase `${host}/student.php/Index/start_evaluate`:\r\n\t\tscore();\r\n\t\tbreak;\r\n\tcase `${host}/student.php/index/start_evaluate`:\r\n\t\tscore();\r\n\t\tbreak;\r\n\tdefault:\r\n\r\n}\r\n// 知识点测评\r\n// http://stu.1000phone.net/student.php/inquiry/index\r\n// http://stu.1000phone.net/student.php/inquiry/set_res/line_id/242/line_node_id/305/paper_id/12\r\nif (location.href.indexOf(\"inquiry/index\") >= 0) {\r\n\tlet singleSelect = document.querySelectorAll('[data-score=\"5.00\"]');\r\n\tfor (let i = 0; i < singleSelect.length; i++) {\r\n\t\tsingleSelect[i].click();\r\n\t}\r\n\tlet multiSelect = document.querySelectorAll('[type=\"checkbox\"]');\r\n\tfor (let j = 0; j < multiSelect.length; j++) {\r\n\t\tmultiSelect[j].click();\r\n\t}\r\n\t(async () => {\r\n\t\tlet data = await ajax(\"GET\", \"https://wscats.github.io/angular-tutorial/control/core.json\");\r\n\t\tconsole.log(data);\r\n\t\tstu.commit = stu.commit.concat(data.commit);\r\n\t\tdocument.querySelector('textarea').value = stu.commit[Math.floor(Math.random() * stu.commit.length)];\r\n\t\tdocument.querySelector('#submit_btn').click();\r\n\t})();\r\n}\n\n//# sourceURL=webpack:///./src/index.js?");

/***/ })

/******/ });
8 changes: 6 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "千锋自动测评",
"manifest_version": 2,
"version": "6.70",
"version": "6.71",
"description": "千锋H5(@mobiletrain.org&&1000phone.com),值得拥有!姚帅,老谢,勇哥,婧婧,琳姐,粤玲,老蓝,Lemon...在广州等你来!",
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
"icons": {
Expand All @@ -21,7 +21,11 @@
],
"browser_action": {
"default_title": "",
"default_icon": "public/icons/128.png",
"default_icon": {
"16": "public/icons/16.png",
"48": "public/icons/48.png",
"128": "public/icons/128.png"
},
"default_popup": "public/template/popup.html"
}
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,10 @@
"bugs": {
"url": "https://github.com/Wscats/hi/issues"
},
"homepage": "https://github.com/Wscats/hi#readme"
"homepage": "https://github.com/Wscats/hi#readme",
"devDependencies": {
"@babel/core": "^7.6.4",
"@babel/preset-env": "^7.6.3",
"babel-loader": "^8.0.0-beta.0"
}
}
30 changes: 29 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
//http://stu.1000phone.net/student.php/Public/login

const { GetRequest, ajax } = require('./tool')
const GetRequest = () => {
//获取url中"?"符后的字串
var url = location.search;
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
}
}
return theRequest;
}

const ajax = (type, url) => {
new Promise((resolve, reject) => {
let xhr = new XMLHttpRequest();
xhr.open(type, url, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
resolve(JSON.parse(xhr.responseText))
} else {
reject(xhr.responseText)
}
}
xhr.send();
})
}

let stu = {
commit: ["666"]
}
Expand Down
3 changes: 2 additions & 1 deletion src/tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ const ajax = (type, url) => {
}

module.export = {
GetRequest
GetRequest,
ajax
}
31 changes: 16 additions & 15 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
const path = require('path');
module.exports = {
mode: 'production',
// mode: 'production',
mode: 'development',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
}
// module: {
// rules: [
// {
// test: /\.js$/,
// exclude: /(node_modules|bower_components)/,
// use: {
// loader: 'babel-loader',
// options: {
// presets: ['@babel/preset-env']
// }
// }
// }
// ]
// }
};

0 comments on commit ac4ed4a

Please sign in to comment.