@peng_kai/kit 0.3.0-beta.16 → 0.3.0-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@peng_kai/kit",
3
3
  "type": "module",
4
- "version": "0.3.0-beta.16",
4
+ "version": "0.3.0-beta.17",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "ISC",
@@ -20,9 +20,9 @@ export class AwsS3 {
20
20
  public constructor(private getParams: TGetParams, private fileHandler?: FileHandler) {
21
21
  }
22
22
 
23
- public async upload(file: File, root?: string) {
23
+ public async upload(file: File, root = 'unclassified') {
24
24
  const s3Client = await this.refreshClient();
25
- const filePath = await this.genFilePath(root || 'unclassified');
25
+ const filePath = root.includes('/') ? root : await this.genFilePath(root);
26
26
  const fileName = await (this.fileHandler?.genFileName?.(file) ?? this.genFileName(file));
27
27
  const fullPath = `${filePath}/${fileName}`;
28
28