1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| import { useCallback, useMemo } from 'react';
| import request from '@/utils/request';
|
| export function useCodeImport() {
|
| const processBatch = useCallback(async (batch) => {
| const res = await request.post('/code/import', batch);
| const { code, msg, data } = res.data;
| if (code === 200) {
|
| } else {
| console.error(msg);
| throw new Error(`Batch import failed: ${msg}`);
| }
| }, []);
|
| return {
| processBatch,
| };
| }
|
|