zhaoyingbo a4555ac862
All checks were successful
CI Monitor CI/CD / build-image (push) Successful in 29s
CI Monitor CI/CD / deploy (push) Successful in 30s
feat: 接入eslint
2024-07-24 10:56:26 +00:00

20 lines
549 B
TypeScript

import { Gitlab } from "../../types/gitlab";
export const gitlabReqWarp = async <T = any>(
func: () => Promise<T>,
default_value: any
): Promise<T> => {
try {
let response = {} as T & Gitlab.Error;
response = (await func()) as T & Gitlab.Error;
if (response.message === "404 Project Not Found") return default_value;
return response;
} catch {
return default_value;
}
};
export const GITLAB_BASE_URL = "https://git.n.xiaomi.com/api/v4";
export const GITLAB_AUTH_HEADER = { "PRIVATE-TOKEN": "Zd1UASPcMwVox5tNS6ep" };