Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3574,6 +3574,17 @@
}
],
"Notes": "Fix loginpage.php loop."
},
"3.4.6": {
"UpdateDate": 1777708421566,
"Prerelease": true,
"UpdateContents": [
{
"PR": 980,
"Description": "Switch all backend endpoints to api.xmoj-script.uk"
}
],
"Notes": "No release notes were provided for this release."
}
}
}
21 changes: 11 additions & 10 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
// @version 3.4.5
// @version 3.4.6
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
Expand All @@ -21,10 +21,11 @@
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_cookie
// @homepage https://www.xmoj-bbs.me/
// @supportURL https://support.xmoj-bbs.me/form/8050213e-c806-4680-b414-0d1c48263677
// @homepage https://www.xmoj-script.uk/
// @supportURL https://github.com/XMOJ-Script-dev/XMOJ-Script/issues
// @connect api.xmoj-bbs.tech
// @connect api.xmoj-bbs.me
// @connect api.xmoj-script.uk
// @connect challenges.cloudflare.com
// @connect cppinsights.io
// @connect cdnjs.cloudflare.com
Expand Down Expand Up @@ -505,7 +506,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/" : "https://api.xmoj-script.uk/") + Action,
headers: {
"Content-Type": "application/json",
"Cache-Control": "no-cache",
Expand Down Expand Up @@ -643,7 +644,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-script.uk") + "/ws/notifications?SessionID=" + Session;

if (UtilityEnabled("DebugMode")) {
console.log("WebSocket: Connecting to", wsUrl);
Expand Down Expand Up @@ -922,7 +923,7 @@ if (UtilityEnabled("AutoLogin") && document.querySelector("body > a:nth-child(1)
}

let SearchParams = new URLSearchParams(location.search);
let ServerURL = (UtilityEnabled("DebugMode") ? "https://ghpages.xmoj-bbs.me/" : "https://www.xmoj-bbs.me")
let ServerURL = (UtilityEnabled("DebugMode") ? "https://ghpages.xmoj-script.uk/" : "https://www.xmoj-script.uk")
if (document.querySelector("#profile") === null && !logined) {
location.href = "https://www.xmoj.tech/loginpage.php";
}
Expand Down Expand Up @@ -5026,7 +5027,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-script.uk/GetImage?ImageID=${ResponseData.Data.ImageID})` + After;
Content.dispatchEvent(new Event("input"));
} else {
Content.value = Before + `![上传失败!` + ResponseData.Message + `]()` + After;
Expand Down Expand Up @@ -5282,7 +5283,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-script.uk/GetImage?ImageID=${ResponseData.Data.ImageID})` + After;
ContentElement.dispatchEvent(new Event("input"));
} else {
ContentElement.value = Before + `![上传失败!]()` + After;
Expand Down Expand Up @@ -5455,7 +5456,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-script.uk/GetImage?ImageID=${ResponseData.Data.ImageID})` + After;
ContentElement.dispatchEvent(new Event("input"));
} else {
ContentElement.value = Before + `![上传失败!]()` + After;
Expand Down Expand Up @@ -5713,7 +5714,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-script.uk/GetImage?ImageID=${ResponseData.Data.ImageID})` + After;
ContentEditor.dispatchEvent(new Event("input"));
} else {
ContentEditor.value = Before + `![上传失败!]()` + After;
Expand Down
4 changes: 1 addition & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@
<a class="nav-link" href="#About">关于</a>
</li>
<li class="nav-item">
<a class="nav-link" href="messages.html">短消息在线看
<span class="badge bg-warning text-dark ms-1">Alpha</span>
</a>
<a class="nav-link" href="messages.html">短消息在线看</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://elxmoj.xmoj-bbs.me" target="_blank" rel="noopener noreferrer">ELXMOJ 客户端</a>
Expand Down
7 changes: 3 additions & 4 deletions messages.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h4 class="mb-1">登录</h4>
<button class="nav-link" data-tab="bookmarklet">书签登录(桌面端)</button>
</li>
<li class="nav-item">
<button class="nav-link" data-tab="sso">统一认证登录</button>
<button class="nav-link" data-tab="sso-develop">统一认证登录(开发中)</button>
Comment thread
PythonSmall-Q marked this conversation as resolved.
</li>
</ul>

Expand Down Expand Up @@ -386,8 +386,8 @@ <h5 class="modal-title" id="user-info-modal-title">用户信息</h5>
'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-script.uk/';
const ASSET_BASE = 'https://assets.xmoj-script.uk/GetImage?ImageID=';
const XMOJ_BASE = 'https://www.xmoj.tech';
const WEBUI_VERSION = 'webui-1.0.0';
const STORAGE_USER = 'xmoj-msg-username';
Expand Down Expand Up @@ -991,7 +991,6 @@ <h5 class="modal-title" id="user-info-modal-title">用户信息</h5>
scope: OAUTH_SCOPE,
state: state
});
location.href = OAUTH_AUTHORIZE_URL + '?' + params.toString();
Comment thread
PythonSmall-Q marked this conversation as resolved.
}

async function exchangeSsoCode(code, state) {
Expand Down
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": "3.4.5",
"version": "3.4.6",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {
Expand Down