From 0b30fc2939b4e1c2d99974a3e6c66aa19a2247e1 Mon Sep 17 00:00:00 2001 From: Zhu Chenrui Date: Sun, 12 Apr 2026 19:23:20 +0800 Subject: [PATCH 1/3] Revert "Migrate XMOJ-BBS client endpoints to `/v1` routes" --- Update.json | 11 ----------- XMOJ.user.js | 14 +++++++------- messages.html | 4 ++-- package.json | 2 +- 4 files changed, 10 insertions(+), 21 deletions(-) diff --git a/Update.json b/Update.json index d28c065e..1103a1bd 100644 --- a/Update.json +++ b/Update.json @@ -3541,17 +3541,6 @@ } ], "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": 1775972372292, - "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 eecedc5c..4ae52ab6 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 3.4.3 +// @version 3.4.2 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen @@ -505,7 +505,7 @@ let RequestAPI = (Action, Data, CallBack) => { } GM_xmlhttpRequest({ method: "POST", - url: (UtilityEnabled("SuperDebug") ? "http://127.0.0.1:8787/v1/" : "https://api.xmoj-bbs.me/v1/") + Action, + url: (UtilityEnabled("SuperDebug") ? "http://127.0.0.1:8787/" : "https://api.xmoj-bbs.me/") + 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") + "/v1/ws/notifications?SessionID=" + Session; + let wsUrl = (UtilityEnabled("SuperDebug") ? "ws://127.0.0.1:8787" : "wss://api.xmoj-bbs.me") + "/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/v1/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; + Content.value = Before + `![](https://assets.xmoj-bbs.me/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/v1/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; + ContentElement.value = Before + `![](https://assets.xmoj-bbs.me/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/v1/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; + ContentElement.value = Before + `![](https://assets.xmoj-bbs.me/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/v1/GetImage?ImageID=${ResponseData.Data.ImageID})` + After; + ContentEditor.value = Before + `![](https://assets.xmoj-bbs.me/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 794b2d3f..ea7e2484 100644 --- a/messages.html +++ b/messages.html @@ -367,8 +367,8 @@ 'use strict'; // ── Constants ────────────────────────────────────────────────────────────── -const API_BASE = 'https://api.xmoj-bbs.me/v1/'; -const ASSET_BASE = 'https://assets.xmoj-bbs.me/v1/GetImage?ImageID='; +const API_BASE = 'https://api.xmoj-bbs.me/'; +const ASSET_BASE = 'https://assets.xmoj-bbs.me/GetImage?ImageID='; const XMOJ_BASE = 'https://www.xmoj.tech'; const WEBUI_VERSION = 'webui-1.0.0'; const STORAGE_USER = 'xmoj-msg-username'; diff --git a/package.json b/package.json index 244106ae..dfcb7f1d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "3.4.3", + "version": "3.4.2", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From cb44bfea33deed729a72d6a0bc227e6196b7b633 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 12 Apr 2026 11:23:41 +0000 Subject: [PATCH 2/3] 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 eb122c8487e337fce3382f949a41a83d4b77bca0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 12 Apr 2026 11:23:47 +0000 Subject: [PATCH 3/3] 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..bf713060 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": 1775993022107, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 974, + "Description": "Revert Migrate" + } + ], + "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 4ae52ab6..15b76f72 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