Files
certd/packages/ui/certd-server/src/utils/http.ts
T

14 lines
305 B
TypeScript
Raw Normal View History

2024-08-21 08:36:03 +08:00
import { utils } from '@certd/pipeline';
export async function request(config: any) {
try {
return await utils.http(config);
} catch (e) {
const data = e.data || e.response?.data;
if (data) {
throw new Error(data.message || data.msg || data.error || data);
}
throw e;
}
}