Track bundled vendor runtime sources
Some checks failed
CI / main (push) Has been cancelled
CI / release-e2e (push) Has been cancelled

This commit is contained in:
2026-07-07 10:05:50 +08:00
parent fbe179ab53
commit 52636c91ae
2111 changed files with 1850012 additions and 14 deletions

25
vendor/aigcpanel/electron/lib/api.ts vendored Normal file
View File

@@ -0,0 +1,25 @@
import Apps from "../mapi/app";
export type ResultType<T> = {
// should follow the rules:
// <0 business error
// =0 success
// 10000 error ( network error, server error, etc. )
code: number;
msg: string;
data?: T;
};
export const post = async (url: string, data: any) => {
data = data || {};
const userAgent = Apps.getUserAgent();
data["AppManagerUserAgent"] = userAgent;
return await fetch(url, {
method: "POST",
headers: {
"User-Agent": userAgent,
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
};