Fuck Yudao

屏蔽芋道官方文档登录校验

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Fuck Yudao
// @namespace    none
// @version      0.2
// @license      MIT
// @description  屏蔽芋道官方文档登录校验
// @author       York Wang
// @match        https://www.iocoder.cn/*
// @match        https://doc.iocoder.cn/*
// @match        https://cloud.iocoder.cn/*
// @grant        GM_xmlhttpRequest
// @grant        unsafeWindow
// ==/UserScript==

(function() {
    'use strict';

    if(document.location.href.startsWith("https://www.iocoder.cn/")) {
        // Official Website
        unsafeWindow.isVIP = function(){return true}
        unsafeWindow.jqueryAlert = ()=>{console.log('fuck yudao');return {close:()=>{}}}
        const locker = document.querySelector("#locker")
        if(locker) {
            locker.style.display = 'none'
        }
        const content = document.querySelector("#post-body")
        if(content) {
            content.style.height = 'auto'
        }
    } else {
        // Official Documents
        let src = ''
        const scripts = document.querySelectorAll("script[src]")
        for (let i = 0; i < scripts.length; ++i) {
            if(scripts[i].src.indexOf('/assets/js/app') > -1) {
                src = scripts[i].src
            }
        }
        if(src) {
            GM_xmlhttpRequest({
                method: 'GET',
                url: src,
                onload: res => {
                    // const a="88974ed8-6aff-48ab-a7d1-4af5ffea88bb",r="shao";function c(){return(Cookies.get(a) ...
                    const key = res.responseText.match(/const \w="([\w-]+)",\w="(\w+)";/)
                    if(key.length > 2) {
                        if(document.cookie.indexOf(key[1]) === -1) {
                            document.cookie = key[1] + '=' + key[2] + ';path=/'
                            location.reload()
                        }
                    }
                }
            })
        }
    }
})();