| | |
| | | // 跨域是否传递 cookie ,默认为 false |
| | | withCredentials: true, |
| | | // 超时时间,默认为 10 秒 |
| | | timeout: 10 * 1000, // 10 秒 |
| | | timeout: 10 * 10000, // 10 秒 |
| | | // 上传前 |
| | | onBeforeUpload (files) { |
| | | loadingInstance = Loading.service({ |
| | |
| | | // message: `${res.data.originalName} 上传失败,请重新尝试` |
| | | // }); |
| | | } |
| | | if(res.data && res.data.url){ |
| | | insertFn(res.data.url, res.data.originname, res.data.imgname) |
| | | } |
| | | }, |
| | | |
| | | // 单个文件上传成功之后 |
| | | onSuccess (file, res) { |
| | | console.log(`${file.originalFilename} 上传成功`, res) |
| | |
| | | // message: `${res.data.originalName} 上传失败,请重新尝试` |
| | | // }); |
| | | } |
| | | if(res.data && res.data.url){ |
| | | insertFn(res.data.url, res.data.url) |
| | | } |
| | | }, |
| | | // 上传进度的回调函数 |
| | | onProgress (progress) { |