From 2db8eceb53bd1de43f747c2cff4c5aa6a7332def Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Apr 2026 02:39:32 +0000 Subject: [PATCH 1/5] refactor: migrate backend calls to /v1 routes Agent-Logs-Url: https://github.com/XMOJ-Script-dev/XMOJ-Script/sessions/606d7c42-f0ad-4d97-80ae-b8d92c2d6725 Co-authored-by: PythonSmall-Q <106425289+PythonSmall-Q@users.noreply.github.com> --- XMOJ.user.js | 12 ++++++------ messages.html | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 4ae52ab6..65e95d61 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -505,7 +505,7 @@ let RequestAPI = (Action, Data, CallBack) => { } GM_xmlhttpRequest({ method: "POST", - url: (UtilityEnabled("SuperDebug") ? "http://127.0.0.1:8787/" : "https://api.xmoj-bbs.me/") + Action, + url: (UtilityEnabled("SuperDebug") ? "http://127.0.0.1:8787/v1/" : "https://api.xmoj-bbs.me/v1/") + Action, headers: { "Content-Type": "application/json", "Cache-Control": "no-cache", @@ -643,7 +643,7 @@ function ConnectNotificationSocket() { return; } - let wsUrl = (UtilityEnabled("SuperDebug") ? "ws://127.0.0.1:8787" : "wss://api.xmoj-bbs.me") + "/ws/notifications?SessionID=" + Session; + let wsUrl = (UtilityEnabled("SuperDebug") ? "ws://127.0.0.1:8787" : "wss://api.xmoj-bbs.me") + "/v1/ws/notifications?SessionID=" + Session; if (UtilityEnabled("DebugMode")) { console.log("WebSocket: Connecting to", wsUrl); @@ -5021,7 +5021,7 @@ int main() "Image": Reader.result }, (ResponseData) => { if (ResponseData.Success) { - Content.value = Before + `![](https://assets.xmoj-bbs.me/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; + Content.value = Before + `![](https://assets.xmoj-bbs.me/v1/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; Content.dispatchEvent(new Event("input")); } else { Content.value = Before + `![上传失败!` + ResponseData.Message + `]()` + After; @@ -5277,7 +5277,7 @@ int main() "Image": Reader.result }, (ResponseData) => { if (ResponseData.Success) { - ContentElement.value = Before + `![](https://assets.xmoj-bbs.me/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; + ContentElement.value = Before + `![](https://assets.xmoj-bbs.me/v1/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; ContentElement.dispatchEvent(new Event("input")); } else { ContentElement.value = Before + `![上传失败!]()` + After; @@ -5450,7 +5450,7 @@ int main() "Image": Reader.result }, (ResponseData) => { if (ResponseData.Success) { - ContentElement.value = Before + `![](https://assets.xmoj-bbs.me/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; + ContentElement.value = Before + `![](https://assets.xmoj-bbs.me/v1/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; ContentElement.dispatchEvent(new Event("input")); } else { ContentElement.value = Before + `![上传失败!]()` + After; @@ -5708,7 +5708,7 @@ int main() "Image": Reader.result }, (ResponseData) => { if (ResponseData.Success) { - ContentEditor.value = Before + `![](https://assets.xmoj-bbs.me/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; + ContentEditor.value = Before + `![](https://assets.xmoj-bbs.me/v1/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; ContentEditor.dispatchEvent(new Event("input")); } else { ContentEditor.value = Before + `![上传失败!]()` + After; diff --git a/messages.html b/messages.html index ea7e2484..794b2d3f 100644 --- a/messages.html +++ b/messages.html @@ -367,8 +367,8 @@ 'use strict'; // ── Constants ────────────────────────────────────────────────────────────── -const API_BASE = 'https://api.xmoj-bbs.me/'; -const ASSET_BASE = 'https://assets.xmoj-bbs.me/GetImage?ImageID='; +const API_BASE = 'https://api.xmoj-bbs.me/v1/'; +const ASSET_BASE = 'https://assets.xmoj-bbs.me/v1/GetImage?ImageID='; const XMOJ_BASE = 'https://www.xmoj.tech'; const WEBUI_VERSION = 'webui-1.0.0'; const STORAGE_USER = 'xmoj-msg-username'; From bf675238f0682fffd03ca1b5807d93b9ed1a7dc2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 11 Apr 2026 02:45:49 +0000 Subject: [PATCH 2/5] 3.4.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dfcb7f1d..244106ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "3.4.2", + "version": "3.4.3", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From cb3db4a9a67de31638d6ba75b3deffe7bc000acc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 11 Apr 2026 02:45:56 +0000 Subject: [PATCH 3/5] Update version info to 3.4.3 --- Update.json | 11 +++++++++++ XMOJ.user.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 1103a1bd..7e7d1d25 100644 --- a/Update.json +++ b/Update.json @@ -3541,6 +3541,17 @@ } ], "Notes": "Add hourly automatic cloud settings sync. Every hour, if CloudSync is enabled, settings are downloaded from the cloud and applied locally, then local settings are uploaded to the cloud. This keeps settings in sync across devices without requiring a visit to the settings page." + }, + "3.4.3": { + "UpdateDate": 1775875549804, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 969, + "Description": "Migrate XMOJ-BBS client endpoints to routes" + } + ], + "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 65e95d61..eecedc5c 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 3.4.2 +// @version 3.4.3 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From 9afb3df53129424f7e795fb32e81f9f381f43d10 Mon Sep 17 00:00:00 2001 From: zsTree Date: Sun, 12 Apr 2026 13:39:12 +0800 Subject: [PATCH 4/5] Update endpoint description in Update.json Signed-off-by: zsTree --- Update.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Update.json b/Update.json index 7e7d1d25..53e484d4 100644 --- a/Update.json +++ b/Update.json @@ -3548,10 +3548,10 @@ "UpdateContents": [ { "PR": 969, - "Description": "Migrate XMOJ-BBS client endpoints to routes" + "Description": "Migrate XMOJ-BBS client endpoints to /v1 routes" } ], "Notes": "No release notes were provided for this release." } } -} \ No newline at end of file +} From 5c6e3c5c815f1cbcb4a4591fa0273ac28dd266ab Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 12 Apr 2026 05:39:38 +0000 Subject: [PATCH 5/5] Update time and description of 3.4.3 --- Update.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Update.json b/Update.json index 53e484d4..d28c065e 100644 --- a/Update.json +++ b/Update.json @@ -3543,15 +3543,15 @@ "Notes": "Add hourly automatic cloud settings sync. Every hour, if CloudSync is enabled, settings are downloaded from the cloud and applied locally, then local settings are uploaded to the cloud. This keeps settings in sync across devices without requiring a visit to the settings page." }, "3.4.3": { - "UpdateDate": 1775875549804, + "UpdateDate": 1775972372292, "Prerelease": true, "UpdateContents": [ { "PR": 969, - "Description": "Migrate XMOJ-BBS client endpoints to /v1 routes" + "Description": "Migrate XMOJ-BBS client endpoints to routes" } ], "Notes": "No release notes were provided for this release." } } -} +} \ No newline at end of file