Skip to content

Commit 52fa631

Browse files
committed
fix: date payload
1 parent 83e1ea1 commit 52fa631

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ picgo set uploader s3
8383
| `{protocol}` | URL 协议 | `http``https` |
8484
| `{host}` | URL 域名 | `s3.amazonaws.com` |
8585
| `{port}` | URL 端口 | `80` |
86-
| `{dir}` | 上传目录 | `my-bucket/2024/12` |
87-
| `{file}` | 上传后的文件名 (含扩展名) | `4aa4f41e38817e5fd38ac870f40dbc70.jpg` |
88-
| `{path}` | 完整路径 (`{dir}/{file}`) | `my-bucket/2024/12/4aa4f41e38817e5fd38ac870f40dbc70.jpg` |
86+
| `{dir}` | 上传目录 | `xxx/2024/12` |
87+
| `{uploadedFileName}` | 上传后的文件名 (含扩展名) | `4aa4f41e38817e5fd38ac870f40dbc70.jpg` |
88+
| `{path}` | 完整路径 (`{dir}/{uploadedFileName}`) | `xxx/2024/12/4aa4f41e38817e5fd38ac870f40dbc70.jpg` |
8989
| `{fileName}` | ****文件名 (含扩展名) | `test.jpg` |
9090
| `{extName}` | ****文件扩展名 (不含 `.`) | `jpg` |
9191
| `{query}` | URL 查询参数 (不含 `?`) | `height=100&width=200` |
@@ -94,7 +94,7 @@ picgo set uploader s3
9494

9595
##### 正则替换
9696

97-
每个变量都支持通过正则表达式进行替换。
97+
每个变量都支持通过正则表达式进行替换(正则替换表达式中间不能有空格)
9898

9999
**语法:**
100100
```

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class FileNameGenerator extends Generateor {
8282
readonly info: IImgInfo
8383

8484
constructor(info: IImgInfo) {
85-
super(info.date)
85+
super(info.uploadDate)
8686
this.info = info
8787
}
8888

@@ -187,7 +187,7 @@ export class OutputURLGenerator extends Generateor {
187187
readonly _info: IImgInfo
188188

189189
constructor(config: IS3UserConfig, info: IImgInfo) {
190-
super(info.date)
190+
super(info.uploadDate)
191191
this._config = config
192192
this._info = info
193193

0 commit comments

Comments
 (0)