mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-03 14:34:40 +00:00
fix(file-browser): reuse download-link API url for copy name and path
This commit is contained in:
@@ -55,7 +55,6 @@ export interface S3Service {
|
||||
uploadFile(filePath: string, contentType: string): Promise<string>
|
||||
uploadFileToKey(filePath: string, key: string, contentType: string): Promise<void>
|
||||
presign(bucket: string, key: string, method: string, download?: boolean): Promise<string>
|
||||
getAbsolutePathOrUrl(bucket: string, key: string): Promise<string>
|
||||
}
|
||||
|
||||
export class S3StorageService implements S3Service {
|
||||
@@ -231,10 +230,6 @@ export class S3StorageService implements S3Service {
|
||||
|
||||
return url
|
||||
}
|
||||
|
||||
async getAbsolutePathOrUrl(bucket: string, key: string): Promise<string> {
|
||||
return this.presign(bucket, key, 'GET', true)
|
||||
}
|
||||
}
|
||||
|
||||
export class LocalStorageService implements S3Service {
|
||||
@@ -446,10 +441,6 @@ export class LocalStorageService implements S3Service {
|
||||
}
|
||||
return url
|
||||
}
|
||||
|
||||
async getAbsolutePathOrUrl(bucket: string, key: string): Promise<string> {
|
||||
return this.getFilePath(bucket, key)
|
||||
}
|
||||
}
|
||||
|
||||
const storageBackend = process.env.STORAGE_BACKEND || 'local'
|
||||
|
||||
Reference in New Issue
Block a user