picgo-plugin-super-prefix icon indicating copy to clipboard operation
picgo-plugin-super-prefix copied to clipboard

fix: replace afterUpload, so that the url returns corresponds the url…

Open apollo600 opened this issue 1 year ago • 0 comments

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: image

 

Patch

  • add afterUploadHandle
  • refactor two handlers to separate functions

apollo600 avatar Nov 14 '23 19:11 apollo600