| | |
| | | port: 9000,//端口号 |
| | | useSSL: false, //true代表使用HTTPS |
| | | accessKey: 'minioadmin', //账户id |
| | | secretKey: 'minioadmin..', //密码 |
| | | partSize: '20M' |
| | | secretKey: 'minioadmin', //密码 |
| | | partSize: '200M' |
| | | }); |
| | | export default { |
| | | name: "FileUpload", |
| | |
| | | "content-length": fileSize |
| | | } |
| | | //判断储存桶是否存在 |
| | | console.log("1111111"); |
| | | minioClient.bucketExists('oafiles', function (err) { |
| | | if (err) { |
| | | if (err.code == 'NoSuchBucket') return console.log("bucket does not exist.") |
| | |
| | | bufferStream.end(new Buffer(ex.target.result)); |
| | | //上传 |
| | | minioClient.putObject('oafiles', fileName, bufferStream, fileSize, metadata, function (err, etag) { |
| | | console.log("1111111"); |
| | | if (err == null) { |
| | | minioClient.presignedGetObject('oafiles', fileName, 24 * 60 * 60, function (err, presignedUrl) { |
| | | if (err) { |