🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

安全微课脚本

呃呃

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         安全微课脚本
// @namespace    https://weiban.mycourse.cn/
// @version      0.1.1
// @description  呃呃
// @author       QCTech
// @match        *://weiban.mycourse.cn/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=weiban.mycourse.cn
// @grant        GM_xmlhttpRequest
// @license      GPLv3
// ==/UserScript==



(function () {
    'use strict';
    const style = document.createElement('style');
    style.innerHTML =
        `
  .md-button {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: #2196f3;
    color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.26);
    transition: all 0.3s ease-in-out;
  }

  .md-button:hover,
  .md-button:focus {
    background-color: #1976d2;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.35);
  }
`;

    document.head.appendChild(style);


    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }

    function finishWxCourse() {
        try {
            console.log(exportRoot.currentFrame)
        } catch (e) {}
        try {
            var finishWxHost = document.referrer.replace("http://", "").replace("https://", "").split("/")[0];
            if (document.referrer == "" || document.referrer == null || document.referrer == undefined) {
                finishWxHost = "weiban.mycourse.cn"
            }

            let q = {};
            document.querySelector('iframe').getAttribute('src').replace(/([^?&=]+)=([^&]+)/g, (_, k, v) => q[k] =
                v);

            const webUrl = window.location.href;
            const finishWxUrl = `https://weiban.mycourse.cn/pharos/usercourse/v1/${q.methodToken}.do`;

            const finishData = {
                "userCourseId": q.userCourseId,
                "tenantCode": q.tenantCode
            };

            $.ajax({
                async: false,
                url: finishWxUrl,
                type: "GET",
                dataType: "jsonp",
                data: finishData,
                timeout: 5000,

                success: function (data) {
                    if (data.msg == "ok") {
                        alert("恭喜,您已完成本微课的学习");
                    } else {
                        alert("发送完成失败");
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {}
            });
        } catch (e) {
            alert("报了啥错误" + e)
        }
    }
    const elementContainer = document.getElementById('app');

    const myButton = document.createElement('button');

    myButton.style.position = 'absolute';
    myButton.style.top = '100px';
    myButton.style.left = '500px';
    myButton.style.heigh = '50px';
    myButton.style.width = '150px';
    myButton.textContent = '点击我速通本课';
    myButton.classList.add('md-button');

    myButton.addEventListener('click', function () {
        finishWxCourse();
        history.back();
    });

    elementContainer.appendChild(myButton);

})();