const fetch = async opt => {
    // table:列表用的测试数据
    const tableData = {
        code: '0',
        data: {
            totalCount: 99999,
            results: [
                {
                    text: 'magna eiusmod',
                    button: 'minim sunt aliqua',
                    image: 'http://dummyimage.com/300x600',
                    image2: 'http://dummyimage.com/125x125',
                    upDown: 89765409.11027372,
                    upDown2: 0.6544,
                    render: 16,
                    input: 'est dolor minim velit',
                    select: 1
                }, {
                    text: 'fugiat',
                    button: 'ut',
                    image: 'http://dummyimage.com/728x90',
                    image2: 'http://dummyimage.com/120x60',
                    upDown: 57872091.0244225,
                    upDown2: 1.987,
                    render: 11,
                    input: 'dolore commodo velit laboris',
                    select: 1
                }, {
                    text: 'officia Duis laborum',
                    button: 'quis Duis exercitation',
                    image: 'http://dummyimage.com/720x300',
                    image2: 'http://dummyimage.com/728x90',
                    upDown: 94737515.0003339,
                    upDown2: 0.6544,
                    render: 13,
                    input: 'nostrud eu',
                    select: 1
                }, {
                    text: 'est culpa ut',
                    button: 'ullamco laboris es',
                    image: 'http://dummyimage.com/720x300',
                    image2: 'http://dummyimage.com/234x60',
                    upDown: 44709622.33534017,
                    upDown2: 0.6544,
                    render: 15,
                    input: 'aliqua deserunt',
                    select: 1
                }, {
                    text: 'amet proident fugiat velit',
                    button: 'dolore aute id magna',
                    image: 'http://dummyimage.com/234x60',
                    image2: 'http://dummyimage.com/720x300',
                    upDown: -97588261.76541567,
                    upDown2: 0.6544,
                    render: 18,
                    input: 'tempor Lorem aliquip pariatur sit',
                    select: 1
                }, {
                    text: 'pariatur adipisicing',
                    button: 'velit dolor laboris',
                    image: 'http://dummyimage.com/336x280',
                    image2: 'http://dummyimage.com/125x125',
                    upDown: -94098109.47816779,
                    upDown2: 0.6544,
                    render: 12,
                    input: 'adipisic',
                    select: 1
                }, {
                    text: 'aliquip eiusmod eu voluptate ut',
                    button: 'magna nisi commodo',
                    image: 'http://dummyimage.com/160x600',
                    image2: 'http://dummyimage.com/120x60',
                    upDown: -89247818.16781789,
                    upDown2: 0.6544,
                    render: 11,
                    input: 'esse amet in dolor',
                    select: 1
                }, {
                    text: 'voluptate aliquip',
                    button: 'minim esse',
                    image: 'http://dummyimage.com/240x400',
                    image2: 'http://dummyimage.com/468x60',
                    upDown: 1215748.4649184495,
                    upDown2: 1.987,
                    render: 14,
                    input: 'dolore laboris',
                    select: 1
                }, {
                    text: 'ut velit voluptate',
                    button: 'Duis cillum aute',
                    image: 'http://dummyimage.com/336x280',
                    image2: 'http://dummyimage.com/300x600',
                    upDown: -44594612.34433029,
                    upDown2: 0.6544,
                    render: 16,
                    input: 'Lorem dolor non',
                    select: 1
                }, {
                    text: 'dolore et ea',
                    button: 'sit ut p',
                    image: 'http://dummyimage.com/250x250',
                    image2: 'http://dummyimage.com/88x31',
                    upDown: 74807251.50394204,
                    upDown2: 0.6544,
                    render: 12,
                    input: 'consequat incididunt fugiat',
                    select: 1
                }],
            pageNumber: 19
        },
        message: 'proident reprehenderit fugiat temp'
    };
    const selectData = {
        code: '0',
        data: [
            { value: 1, label: '1' },
            { value: 2, label: '2' },
            { value: 3, label: '3' }
        ],
        message: 'proident reprehenderit fugiat temp'
    };
    // console.log('fetchOpt：\n',opt)
    switch (opt.url) {
    case '/api/options-test': {
        return Promise.resolve(selectData);
    }
    case '/api/list-test': {
        return Promise.resolve(tableData);
    }
    default: {
        return Promise.resolve(tableData);
    }
    }
};
export default fetch;
