添加public管理
This commit is contained in:
18
src/routes-simple/minio/download.ts
Normal file
18
src/routes-simple/minio/download.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { minioClient } from '@/app.ts';
|
||||
import { bucketName } from '@/modules/minio.ts';
|
||||
|
||||
import { router } from '../router.ts';
|
||||
|
||||
router.post('/api/minio', async (ctx) => {
|
||||
let { username, appKey } = { username: '', appKey: '' };
|
||||
const path = `${username}/${appKey}`;
|
||||
const res = await minioClient.listObjects(bucketName, path, true);
|
||||
const file = res.filter((item) => item.isFile);
|
||||
const fileList = file.map((item) => {
|
||||
return {
|
||||
name: item.name,
|
||||
size: item.size,
|
||||
};
|
||||
});
|
||||
// ctx.body = fileList;
|
||||
});
|
||||
Reference in New Issue
Block a user