V 2.2.10 新增MJ的代理模式

This commit is contained in:
2024-06-24 13:11:19 +08:00
parent 79a1929e79
commit bac97bc41c
102 changed files with 6374 additions and 1172 deletions
+6
View File
@@ -1,6 +1,7 @@
import { basicApi } from "./apiBasic";
import { Tools } from "../main/tools";
import { define } from "../define/define";
export class DiscordAPI {
constructor() {
@@ -19,6 +20,11 @@ export class DiscordAPI {
let headers = {
"Authorization": key
}
if (url.includes(define.remotemj_api)) {
headers = {
"mj-api-secret": define.API
}
}
res = await basicApi.get(url, headers);
let progress = res.data.progress && res.data.progress.length > 0 ? parseInt(res.data.progress.slice(0, -1)) : 0;