Skip to content

Commit

Permalink
Merge pull request #315 from XMOJ-Script-dev/boomzero/working-branch
Browse files Browse the repository at this point in the history
修复无法在某些页面检查登录状态
  • Loading branch information
boomzero authored Dec 22, 2023
2 parents 40571c0 + 0a767f8 commit b04cd73
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
11 changes: 11 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,17 @@
}
],
"Notes": "Welcome!"
},
"1.1.7": {
"UpdateDate": 1703253098623,
"Prerelease": true,
"UpdateContents": [
{
"PR": 315,
"Description": "修复无法在某些页面检查登录状态"
}
],
"Notes": "<big>test:</big> 这个算release notes吗?<a href=\"https://www.xmoj.tech/userinfo.php?user=chenlangning\" class=\"link-offset-2 link-underline-opacity-50 link-danger\" ;\"=\"\">chenlangning</a>"
}
}
}
8 changes: 7 additions & 1 deletion XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion backend
Submodule backend updated 1 files
+6 −1 Source/Process.ts
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit b04cd73

Please sign in to comment.