Skip to content

Commit

Permalink
Update the api domain (#552)
Browse files Browse the repository at this point in the history
* Update the domain

Signed-off-by: Zhu Chenrui <Thomas_rainbowfish@icloud.com>

* 1.1.72

* Update version info to 1.1.72

* rel notes

Signed-off-by: Zhu Chenrui <Thomas_rainbowfish@icloud.com>

* Update time and description of 1.1.72

---------

Signed-off-by: Zhu Chenrui <Thomas_rainbowfish@icloud.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
boomzero and github-actions[bot] authored Jul 21, 2024
1 parent 02dcaea commit 9e80ea1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
11 changes: 11 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -1640,6 +1640,17 @@
}
],
"Notes": "No release notes were provided for this release."
},
"1.1.72": {
"UpdateDate": 1721535836758,
"Prerelease": true,
"UpdateContents": [
{
"PR": 552,
"Description": "Update the api domain"
}
],
"Notes": "Please note that users using DebugMode should update immediately. <br> The domain ghpages.xmoj-bbs.tech will be updated at a later date."
}
}
}
15 changes: 8 additions & 7 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
// @version 1.1.71
// @version 1.1.72
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
Expand All @@ -20,9 +20,10 @@
// @grant unsafeWindow
// @grant GM_setValue
// @grant GM_getValue
// @homepage https://www.xmoj-bbs.tech/
// @homepage https://www.xmoj-bbs.me/
// @supportURL https://xmojscript.zohodesk.com/portal/zh/newticket
// @connect api.xmoj-bbs.tech
// @connect api.xmoj-bbs.me
// @connect challenges.cloudflare.com
// @connect cppinsights.io
// @connect cdn.bootcdn.net
Expand Down Expand Up @@ -342,7 +343,7 @@ let RequestAPI = (Action, Data, CallBack) => {
}
GM_xmlhttpRequest({
method: "POST",
url: (UtilityEnabled("SuperDebug") ? "http://127.0.0.1:8787/" : "https://api.xmoj-bbs.tech/") + Action,
url: (UtilityEnabled("SuperDebug") ? "http://127.0.0.1:8787/" : "https://api.xmoj-bbs.me/") + Action,
headers: {
"Content-Type": "application/json"
},
Expand Down Expand Up @@ -389,7 +390,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.tech/" : "https://web.xmoj-bbs.tech")
let ServerURL = (UtilityEnabled("DebugMode") ? "https://ghpages.xmoj-bbs.tech/" : "https://www.xmoj-bbs.me")
let CurrentUsername = document.querySelector("#profile").innerText;
CurrentUsername = CurrentUsername.replaceAll(/[^a-zA-Z0-9]/g, "");
let IsAdmin = AdminUserList.indexOf(CurrentUsername) !== -1;
Expand Down Expand Up @@ -4087,7 +4088,7 @@ int main()
"Image": Reader.result
}, (ResponseData) => {
if (ResponseData.Success) {
ContentElement.value = Before + `![](https://assets.xmoj-bbs.tech/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;
Expand Down Expand Up @@ -4259,7 +4260,7 @@ int main()
"Image": Reader.result
}, (ResponseData) => {
if (ResponseData.Success) {
ContentElement.value = Before + `![](https://assets.xmoj-bbs.tech/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;
Expand Down Expand Up @@ -4508,7 +4509,7 @@ int main()
"Image": Reader.result
}, (ResponseData) => {
if (ResponseData.Success) {
ContentEditor.value = Before + `![](https://assets.xmoj-bbs.tech/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;
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": "1.1.71",
"version": "1.1.72",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {
Expand Down

0 comments on commit 9e80ea1

Please sign in to comment.