12345678910111213141516171819202122232425262728293031323334353637 |
- import { commonConfig } from '../common/config';
- export function uploadImg(event,fileList) {
- return new Promise((resolve,reject)=>{
-
- let lists = [].concat(event.file)
- let fileListLen = fileList.length
- lists.map((item) => {
- fileList.push({
- ...item
- })
- })
-
-
- for (let i = 0; i < lists.length; i++) {
- uni.uploadFile({
- url: commonConfig.uploadFileUrl,
- filePath: lists[i].url,
- name: 'file',
- formData: {
- bucket: 'greattransition'
- },
- success: (res) => {
- let resolveData = {
- data: res.data,
- fileListLen: fileListLen
- }
-
- console.log('resolveData===',resolveData);
- resolve(resolveData);
- fileListLen++
- }
- });
- }
- })
- }
|