diff --git a/Update.json b/Update.json index ce92ef55..ecb95bec 100644 --- a/Update.json +++ b/Update.json @@ -2873,6 +2873,17 @@ } ], "Notes": "No release notes were provided for this release." + }, + "1.7.3": { + "UpdateDate": 1750594769202, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 811, + "Description": "fix: Redirect to login page if profile element is missing" + } + ], + "Notes": "No release notes were provided for this release." } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 6075d804..ebaa803b 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.7.2 +// @version 1.7.3 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen @@ -559,6 +559,9 @@ window.addEventListener('DOMContentLoaded', async () => { let SearchParams = new URLSearchParams(location.search); let ServerURL = (UtilityEnabled("DebugMode") ? "https://ghpages.xmoj-bbs.me/" : "https://www.xmoj-bbs.me") + if (document.querySelector("#profile") === null) { + location.href = "https://www.xmoj.tech/loginpage.php"; + } let CurrentUsername = document.querySelector("#profile").innerText; CurrentUsername = CurrentUsername.replaceAll(/[^a-zA-Z0-9]/g, ""); let IsAdmin = AdminUserList.indexOf(CurrentUsername) !== -1; diff --git a/package.json b/package.json index 76b8b358..e034b7fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "1.7.2", + "version": "1.7.3", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": {