fix oss import bug

pull/1911/head
haibingtown 2 years ago
parent 88409cc1f0
commit 8587d18868

@ -172,6 +172,15 @@ func (handler *Driver) List(ctx context.Context, base string, recursive bool) ([
if err != nil { if err != nil {
continue continue
} }
if strings.HasSuffix(object.Key, "/") {
res = append(res, response.Object{
Name: path.Base(object.Key),
RelativePath: filepath.ToSlash(rel),
Size: 0,
IsDir: true,
LastModify: time.Now(),
})
} else {
res = append(res, response.Object{ res = append(res, response.Object{
Name: path.Base(object.Key), Name: path.Base(object.Key),
Source: object.Key, Source: object.Key,
@ -181,6 +190,7 @@ func (handler *Driver) List(ctx context.Context, base string, recursive bool) ([
LastModify: object.LastModified, LastModify: object.LastModified,
}) })
} }
}
return res, nil return res, nil
} }

Loading…
Cancel
Save