Kuingsmile / PicList

An image upload and manage tool, base on PicGo
https://piclist.cn
MIT License
2.18k stars 91 forks source link

[Bug]: 通过相册菜单删除图片会闪退 #111

Closed vaxl029 closed 1 year ago

vaxl029 commented 1 year ago

前置阅读 | Pre-reading

PicList的版本 | PicList Version

v2.6.6

系统信息 | System Information

Windows

问题重现 | Bug reproduce

前置条件 win10 x64,lankong 1.1.3插件,开源版lskypro

复现流程 随意上传一张图片,然后通过相册菜单点击图片下面的删除按钮,然后二次确认弹窗点击确认,程序闪退

重新打开程序,相册菜单里面对应的图片已经删除,不管是否开启 删除云端 都会闪退,开启后 lskypro 后台对应图片会被删除,所以综合来看 删除功能是正常的

相关日志 | Logs

2023-11-01 16:16:40 [PicList INFO] Compress or convert image 2023-11-01 16:16:40 [PicList INFO] Before transform 2023-11-01 16:16:40 [PicList INFO] Transforming... Current transformer is [path] 2023-11-01 16:16:40 [PicList INFO] Before upload 2023-11-01 16:16:40 [PicList INFO] beforeUploadPlugins: renameFn running 2023-11-01 16:16:40 [PicList INFO] Uploading... Current uploader is [lankong] 2023-11-01 16:16:41 [PicList SUCCESS] https://XXXXX/XXX.webp 2023-11-01 16:20:25 [PicList INFO] [PicList Server] is listening at 36677 of 0.0.0.0 2023-11-01 16:20:25 [PicList INFO] File server is running, http://localhost:36699 2023-11-01 16:22:12 [PicList INFO] [PicList Server] is listening at 36677 of 0.0.0.0 2023-11-01 16:22:12 [PicList INFO] File server is running, http://localhost:36699

Kuingsmile commented 1 year ago

@vaxl029

问题定位

问题来自于兰空插件自带的同步删除功能 image

在PicGo或者PicList里,使用这个插件都可以得到相同的错误日志记录:

image image

问题定位在插件的index.js文件中的第40行: image

这里返回的body已经是对象了,所以不能去做JSON.parse(),导致报错,由于PicList里没有捕获这个异常,所以表现为PicList自动退出

解决方案

这个文件的路径是%APPDATA%\piclist\node_modules\picgo-plugin-lankong\dist\index.js, 注释掉这一句就ok了,如下 image

或者直接用我修改后的文件替换掉原文件,然后重启piclist就可以了

index.zip

vaxl029 commented 1 year ago

经测试可行,感谢

jixintangen commented 10 months ago

刚装完lsky,也遇到了这个问题,来翻issues,感谢