Kuingsmile/PicList

[Bug]: piclist客户端设置piclist-core搭建的服务端作为图床时,上传失败

Closed this issue · 4 comments

前置阅读 | Pre-reading

PicList的版本 | PicList Version

v2.9.2

系统信息 | System Information

Windows

问题重现 | Bug reproduce

  1. 服务端使用piclist-core搭建服务端,通过HTTP API上传图片时一切正常
  2. 客户端设置此服务端为图床上传后端,相关配置文件如下:
"piclist": {
      "_configName": "local",
      "_id": "5958d476-52b7-4d16-bd4e-bf4d6d1c35bb",
      "_createdAt": 1723863275585,
      "_updatedAt": 1723874964901,
      "host": "https://xxxxx.xxxxx.com",
      "port": "xxxxx",
      "picbed": "local",
      "configName": "config",
      "serverKey": "xxxxxxxxxxxxxx"
    },

按配置中一样的地址、端口和serverKey,可以正常走HTTP API上传图片,但是在客户端设置piclist uploader上传时则失败,错误日志见下

相关日志 | Logs

2024-08-17 14:08:05 [PicList INFO] Before transform 
2024-08-17 14:08:05 [PicList INFO] Transforming... Current transformer is [path] 
2024-08-17 14:08:05 [PicList INFO] Before upload 
2024-08-17 14:08:05 [PicList INFO] beforeUploadPlugins: renameFn running 
2024-08-17 14:08:05 [PicList INFO] Uploading... Current uploader is [piclist] 
2024-08-17 14:08:06 [PicList WARN] failed 
2024-08-17 14:08:06 [PicList ERROR] 
------Error Stack Begin------
Error
    at Object.yr [as handle] (C:\Program Files\PicList\resources\app.asar\node_modules\piclist\dist\index.cjs.js:1:78585)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Gt.doUpload (C:\Program Files\PicList\resources\app.asar\node_modules\piclist\dist\index.cjs.js:1:47027)
    at async Gt.start (C:\Program Files\PicList\resources\app.asar\node_modules\piclist\dist\index.cjs.js:1:45869)
    at async pn.upload (C:\Program Files\PicList\resources\app.asar\node_modules\piclist\dist\index.cjs.js:1:158089)
    at async Object.upload (C:\Program Files\PicList\resources\app.asar\index.js:8:2101967)
    at async wo (C:\Program Files\PicList\resources\app.asar\index.js:8:2109816)
    at async IpcMainImpl.rpcEventHandler (C:\Program Files\PicList\resources\app.asar\index.js:8:2463698)
-------Error Stack End------- 
2024-08-17 14:08:06 [PicList ERROR] 
------Error Stack Begin------
Error
    at Object.yr [as handle] (C:\Program Files\PicList\resources\app.asar\node_modules\piclist\dist\index.cjs.js:1:78585)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Gt.doUpload (C:\Program Files\PicList\resources\app.asar\node_modules\piclist\dist\index.cjs.js:1:47027)
    at async Gt.start (C:\Program Files\PicList\resources\app.asar\node_modules\piclist\dist\index.cjs.js:1:45869)
    at async pn.upload (C:\Program Files\PicList\resources\app.asar\node_modules\piclist\dist\index.cjs.js:1:158089)
    at async Object.upload (C:\Program Files\PicList\resources\app.asar\index.js:8:2101967)
    at async wo (C:\Program Files\PicList\resources\app.asar\index.js:8:2109816)
    at async IpcMainImpl.rpcEventHandler (C:\Program Files\PicList\resources\app.asar\index.js:8:2463698)
-------Error Stack End------- 

image
自己加https了?

自己加https了?

对😂我给整个服务套了个nginx做https的,有这方面的原因嘛?
我试了一下,不加https就直接连不上了

http api直接上传没问题,不知为啥客户端不行,照理走的是同一个地址呢🤔

没考虑自己做反代这种情况
image
代码里直接拼接的地址,我修改下判断逻辑