mirror of
https://github.com/certd/certd.git
synced 2026-06-30 00:07:37 +08:00
14 lines
305 B
TypeScript
14 lines
305 B
TypeScript
|
|
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;
|
||
|
|
}
|
||
|
|
}
|