feat: 新增app管理和文件管理
This commit is contained in:
27
src/scripts/get-minio-list.ts
Normal file
27
src/scripts/get-minio-list.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { bucketName, minioClient } from '@/modules/minio.ts';
|
||||
|
||||
const main = async () => {
|
||||
const res = await new Promise((resolve, reject) => {
|
||||
let res: any[] = [];
|
||||
let hasError = false;
|
||||
minioClient
|
||||
.listObjectsV2(bucketName, 'root/codeflow/0.0.1/')
|
||||
.on('data', (data) => {
|
||||
res.push(data);
|
||||
})
|
||||
.on('error', (err) => {
|
||||
console.error('error', err);
|
||||
hasError = true;
|
||||
})
|
||||
.on('end', () => {
|
||||
if (hasError) {
|
||||
reject();
|
||||
return;
|
||||
} else {
|
||||
resolve(res);
|
||||
}
|
||||
});
|
||||
});
|
||||
console.log(res);
|
||||
};
|
||||
main();
|
||||
Reference in New Issue
Block a user