Compare commits
	
		
			3 Commits
		
	
	
		
			ab29a1eb0b
			...
			main
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 7e3b748d30 | |||
| cd43d66265 | |||
| 0dae4872b0 | 
| @@ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|   "name": "@kevisual/oss", |   "name": "@kevisual/oss", | ||||||
|   "version": "0.0.11", |   "version": "0.0.12", | ||||||
|   "main": "dist/index.js", |   "main": "dist/index.js", | ||||||
|   "scripts": { |   "scripts": { | ||||||
|     "build": "tsup", |     "build": "tsup", | ||||||
|   | |||||||
							
								
								
									
										12
									
								
								src/index.ts
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								src/index.ts
									
									
									
									
									
								
							| @@ -152,14 +152,18 @@ export class OssBase implements OssBaseOperation { | |||||||
|     const obj = await this.client.fPutObject(bucketName, `${this.prefix}${objectName}`, filePath, metaData); |     const obj = await this.client.fPutObject(bucketName, `${this.prefix}${objectName}`, filePath, metaData); | ||||||
|     return obj as any; |     return obj as any; | ||||||
|   } |   } | ||||||
|  |   /** | ||||||
|  |    * 获取完整的对象名称 | ||||||
|  |    * @param objectName | ||||||
|  |    * @returns | ||||||
|  |    */ | ||||||
|  |   async getObjectName(objectName: string) { | ||||||
|  |     return `${this.prefix}${objectName}`; | ||||||
|  |   } | ||||||
|   async statObject(objectName: string, checkFile = true) { |   async statObject(objectName: string, checkFile = true) { | ||||||
|     const bucketName = this.bucketName; |     const bucketName = this.bucketName; | ||||||
|     try { |     try { | ||||||
|       const obj = await this.client.statObject(bucketName, `${this.prefix}${objectName}`); |       const obj = await this.client.statObject(bucketName, `${this.prefix}${objectName}`); | ||||||
|       if (obj && checkFile && obj.size === 0) { |  | ||||||
|         return null; |  | ||||||
|       } |  | ||||||
|       return obj; |       return obj; | ||||||
|     } catch (e) { |     } catch (e) { | ||||||
|       if (e.code === 'NotFound') { |       if (e.code === 'NotFound') { | ||||||
|   | |||||||
| @@ -54,7 +54,6 @@ export const sendObject = async ({ res, objectName, client, isDownload = false } | |||||||
|       etag, |       etag, | ||||||
|       'last-modified': lastModified, |       'last-modified': lastModified, | ||||||
|       'Content-Disposition': contentDisposition, |       'Content-Disposition': contentDisposition, | ||||||
|       'file-name': filename, |  | ||||||
|       ...filteredMetaData, |       ...filteredMetaData, | ||||||
|     }); |     }); | ||||||
|     const objectStream = await client.getObject(objectName); |     const objectStream = await client.getObject(objectName); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user