export const handleRequest = async (reqConfig) => {
    return new Promise((resolve, reject) => {

        /** 普通请求 */
        reqConfig.dataType === 'json' && uni.request({
            ...reqConfig,
            success: function (res) {
                resolve(res.data);
            },
            fail: function (err) {
                reject(err);
            },
        });

        /** 文件上传 */
        const uploadParams = JSON.parse(JSON.stringify(reqConfig));
        // 上传会自己带
        delete uploadParams.data.file;
        reqConfig.dataType === 'formData' && uni.uploadFile({
            url: reqConfig.url,
            formData: uploadParams.data,
            header: {
               Token:uploadParams.header.Token
            },
            success: function (res) {
                resolve(JSON.parse(res.data));
            },
            fail: function (err) {
                reject(err);
            },
        });

        /** 文件下载 */
        const downloadParams = JSON.parse(JSON.stringify(reqConfig));

    });
}