// ==UserScript== // @name 📚 国开智能刷课助手 // @namespace http://tampermonkey.net/ // @version 2.2.5 // @description 国开自动刷课 - 云端授权版 智能反检测,q反馈群:612441267 // @author lakay666 // @match *://lms.ouchn.cn/course/* // @match *://lms.ouchn.cn/user/courses* // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @grant GM_setClipboard // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand // @grant GM_notification // @grant unsafeWindow // @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.2.0/crypto-js.min.js // @run-at document-end // ==/UserScript== (function() { 'use strict'; const SERVER = 'http://150.158.119.55:3000'; const SK = 'gkbk_activation_code'; const mc = (() => { const gd = typeof unsafeWindow !== 'undefined' ? unsafeWindow.globalData : window.globalData; if (!gd || !gd.user || !gd.user.id) return null; let h = 0; const u = String(gd.user.userNo || gd.user.id); for (let i = 0; i < u.length; i++) { h = ((h << 5) - h) + u.charCodeAt(i); h |= 0; } return Math.abs(h).toString(16).toUpperCase(); })(); const un = (() => { const gd = typeof unsafeWindow !== 'undefined' ? unsafeWindow.globalData : window.globalData; return gd?.user?.name || '未知'; })(); function showLoading(msg) { let el = document.getElementById('gkbk-loading'); if (!el) { el = document.createElement('div'); el.id = 'gkbk-loading'; el.style.cssText = 'position:fixed;top:20px;right:20px;padding:12px 20px;background:#2d8cf0;color:#fff;border-radius:8px;z-index:2147483647;font-size:14px;box-shadow:0 4px 12px rgba(0,0,0,0.15);'; document.body.appendChild(el); } el.textContent = '📚 ' + msg; } function hideLoading() { const el = document.getElementById('gkbk-loading'); if (el) el.remove(); } function showAuthPanel() { if (document.querySelector('#gkbk-auth-panel')) return; const panel = document.createElement('div'); panel.id = 'gkbk-auth-panel'; panel.style.cssText = 'position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:360px;background:#fff;border-radius:16px;box-shadow:0 8px 32px rgba(0,0,0,0.2);z-index:2147483647;padding:24px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;'; panel.innerHTML = '