diff --git a/Update.json b/Update.json index 11ae6933..027b5259 100644 --- a/Update.json +++ b/Update.json @@ -750,6 +750,17 @@ } ], "Notes": "Welcome!" + }, + "1.1.7": { + "UpdateDate": 1703253098623, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 315, + "Description": "修复无法在某些页面检查登录状态" + } + ], + "Notes": "test: 这个算release notes吗?chenlangning" } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 5b4ceb56..72d20df4 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.1.6 +// @version 1.1.7 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen @@ -384,6 +384,12 @@ GM_registerMenuCommand("重置数据", () => { } }); +//otherwise CurrentUsername might be undefined +if (UtilityEnabled("AutoLogin") && document.querySelector("body > a:nth-child(1)") != null && document.querySelector("body > a:nth-child(1)").innerText == "请登录后继续操作") { + localStorage.setItem("UserScript-LastPage", location.pathname + location.search); + location.href = "https://www.xmoj.tech/loginpage.php"; +} + let SearchParams = new URLSearchParams(location.search); let ServerURL = (UtilityEnabled("DebugMode") ? "https://ghpages.xmoj-bbs.tech/" : "https://web.xmoj-bbs.tech") let CurrentUsername = document.querySelector("#profile").innerText; diff --git a/backend b/backend index 44397ceb..33a738d7 160000 --- a/backend +++ b/backend @@ -1 +1 @@ -Subproject commit 44397ceb031f7c19500e4a8a6208ee849a57732f +Subproject commit 33a738d7ba68fcb962b5fe83b1447cd24f5aa70e diff --git a/package.json b/package.json index cc267e1e..4acf26f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "1.1.6", + "version": "1.1.7", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": {