Blame view

api/upload.js 537 Bytes
9b30ab8c   刘淇   新增快速工单,原版
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  
  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);
        },
      });
    });
  };