
import globalConfig from '@/common/config/global';
import cache from '@/common/utils/cache';

const fileUpload = '/app-api/infra/file/upload'

export  const uploadFilePromise = (url) => {
  return new Promise((resolve, reject) => {
    let a = uni.uploadFile({
      url: `${globalConfig.api.baseUrl}${fileUpload}`,
      filePath: url,
      name: 'file',
      formData: {
        user: 'test',
      },
      success: (res) => {
        setTimeout(() => {
          resolve(res.data.data);
        }, 1000);
      },
    });
  });
};