Initial clean project import

This commit is contained in:
cat-shark
2026-06-19 18:41:41 +08:00
commit a13b804c7a
1306 changed files with 220568 additions and 0 deletions
+25
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),
});
};