Greasy Fork is available in English.

北理工培养方案显示已获得学分

用户在北理工本硕博一体化系统—我的培养方案中可以查看到系统内的已获得学分,查询结果仅供参考。

Instalează acest script?
Script sugerat de autor

Poate îți va plăcea și优化北理工成绩列表显示.

Instalează acest script
// ==UserScript==
// @name         北理工培养方案显示已获得学分
// @namespace    https://blog.csdn.net/c20180630
// @version      1.0.5
// @description  用户在北理工本硕博一体化系统—我的培养方案中可以查看到系统内的已获得学分,查询结果仅供参考。
// @author       XiaoZheng2003
// @match        https://jxzxehallapp.bit.edu.cn/jwapp/sys/xsfacx/*default/index.do
// @match        https://jxzxehallapp.bit.edu.cn/jwapp/sys/xsfacx/*default/index.do?*
// @match        https://webvpn.bit.edu.cn/https/77726476706e69737468656265737421faef5b842238695c720999bcd6572a216b231105adc27d/jwapp/sys/xsfacx/*default/index.do
// @match        https://webvpn.bit.edu.cn/https/77726476706e69737468656265737421faef5b842238695c720999bcd6572a216b231105adc27d/jwapp/sys/xsfacx/*default/index.do?*
// @icon         https://www.bit.edu.cn/images/gb20190805/logo_01.png
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';
    $(document).ready(function () {
        var web = "https://jxzxehallapp.bit.edu.cn/jwapp/sys/xsfacx/modules/pyfacxepg/grpyfacx.do";
        var webvpn = "https://webvpn.bit.edu.cn/https/77726476706e69737468656265737421faef5b842238695c720999bcd6572a216b231105adc27d/jwapp/sys/xsfacx/modules/pyfacxepg/grpyfacx.do";
        fetch(window.location.host.includes("webvpn") ? webvpn : web)
            .then((response) => response.json())
            .then((data) => {
                // 获取已获得学分的数值
                const creditSum = data.datas.grpyfacx.rows[0].YWCXF;
                console.log("已获得学分:" + creditSum);
                
                //弹窗提示
                alert("已获得学分:" + creditSum);
                
                //显示在页面上
                let retryCnt = 0, maxRetry = 20;
                var timer = setInterval(function () {
                    try {
                        document.querySelector("#mainPage > div > div > div:nth-child(2)").innerHTML += "<br>系统内查询到的已获得学分:" + creditSum;
                        clearInterval(timer);
                    }
                    catch {
                        retryCnt++;
                        console.log("当前重试次数:" + retryCnt);
                        if (retryCnt > maxRetry) {
                            clearInterval(timer);
                        }
                    }
                }, 1000);
            })
            .catch((error) => {
                //发生错误重新加载页面
                location.reload();
            });
    });
}());