feat: 上传文件到minio

This commit is contained in:
2024-10-07 01:54:13 +08:00
parent 477ad00d86
commit 8beb65e637
11 changed files with 195 additions and 104 deletions

View File

@@ -1,5 +1,5 @@
import { bucketName, minioClient } from '@/modules/minio.ts';
import { S3Error } from 'minio';
const main = async () => {
const res = await new Promise((resolve, reject) => {
let res: any[] = [];
@@ -24,4 +24,17 @@ const main = async () => {
});
console.log(res);
};
main();
// main();
const main2 = async () => {
try {
const obj = await minioClient.statObject(bucketName, 'root/codeflow/0.0.1/README.md');
console.log(obj);
} catch (e) {
console.log('', e.message, '\n\r', e.code);
// console.error(e);
}
};
main2();