#
luxiaotao1123
2024-09-19 d2adaf492a992dfbcbe117ecc1fa2b7e4d8aaf73
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,
    };
}