picgo-plugin-super-prefix
picgo-plugin-super-prefix copied to clipboard
fix: replace afterUpload, so that the url returns corresponds the url…
Problem info
The plugin changes the dirname and filename before upload, but in return url dir name is missing. As a result, uploaded img cannot be shown because invariant url. Issue #9
Specifically, the filename uploaded is prefix + fileName + extName
, but what we got is only fileName + extName
, what happened is:
# Before upload
beforeUploadPlugins: super-prefix running # result is right: 2023/2023-11-15/2023-11-15T03:36:58.png
# Uploader finished
Uploading... Current uploader is [gitee] # result is wrong: 2023-11-15T03:36:58.png
So we should rename again after uploading:
# Before upload
beforeUploadPlugins: super-prefix running # result is right: 2023/2023-11-15/2023-11-15T03:36:58.png
# Uploader finished
Uploading... Current uploader is [gitee] # result is wrong: 2023-11-15T03:36:58.png
# After upload
afterUploadPlugins: super-prefix running # result is right: 2023/2023-11-15/2023-11-15T03:36:58.png
Referrence:
Patch
- add afterUploadHandle
- refactor two handlers to separate functions