fix: minio
This commit is contained in:
parent
ce54da72c9
commit
c9437d7c67
|
@ -4,7 +4,6 @@ import { isEmpty } from 'lodash';
|
||||||
import { ConfigKeyPaths } from '~/config';
|
import { ConfigKeyPaths } from '~/config';
|
||||||
import { generateRandomValue } from '~/utils';
|
import { generateRandomValue } from '~/utils';
|
||||||
import { SFileInfo, SFileInfoDetail, SFileList } from './manage.class';
|
import { SFileInfo, SFileInfoDetail, SFileList } from './manage.class';
|
||||||
import * as Minio from 'Minio';
|
|
||||||
import { InjectMinio } from 'nestjs-minio';
|
import { InjectMinio } from 'nestjs-minio';
|
||||||
import { Client } from 'minio';
|
import { Client } from 'minio';
|
||||||
|
|
||||||
|
@ -29,7 +28,7 @@ export class NetDiskManageService {
|
||||||
return new Promise<SFileList>((resolve, reject) => {
|
return new Promise<SFileList>((resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
const fileStream = this.minioClient.listObjects(this.ossConfig.bucket, prefix, false);
|
const fileStream = this.minioClient.listObjects(this.ossConfig.bucket, prefix, false);
|
||||||
this.readStreamData<Minio.BucketItem>(fileStream).then(respBody => {
|
this.readStreamData<any>(fileStream).then(respBody => {
|
||||||
console.log(respBody);
|
console.log(respBody);
|
||||||
const dirs = respBody.filter(item => 'prefix' in item).map(item => item.prefix);
|
const dirs = respBody.filter(item => 'prefix' in item).map(item => item.prefix);
|
||||||
const files = respBody.filter(item => !('prefix' in item));
|
const files = respBody.filter(item => !('prefix' in item));
|
||||||
|
|
Loading…
Reference in New Issue