sb-sb / smms-wordpress-plugin

SM.MS WordPress Plugin
47 stars 7 forks source link

api重复文件上传响应不规范我能在这提交吗? #3

Open 1265578519 opened 4 years ago

1265578519 commented 4 years ago

URL: {"success":true,"code":"success","message":"Upload success.","data":{"file_id":0,"width":256,"height":256,"filename":"Test.png","storename":"WSfJZuTP2bi94Ik.png","size":27378,"path":"/2020/03/08/WSfJZuTP2bi94Ik.png","hash":"d4bT9laPq36sjCnH8G7prcWQmD","url":"https://i.loli.net/2020/03/08/WSfJZuTP2bi94Ik.png","delete":"https://sm.ms/delete/d4bT9laPq36sjCnH8G7prcWQmD","page":"https://sm.ms/image/WSfJZuTP2bi94Ik"},"RequestId":"6C2C7F20-FB9D-4AE6-86C1-6437DCFD9797"}

OR

URL: {"success":false,"code":"image_repeated","message":"Image upload repeated limit, this image exists at: https://i.loli.net/2020/03/08/WSfJZuTP2bi94Ik.png","images":"https://i.loli.net/2020/03/08/WSfJZuTP2bi94Ik.png","RequestId":"9F919157-AF31-4BE0-B74F-0106661DF8EB"}

导致data.url无法获取到重复文件的url

1265578519 commented 4 years ago

想自己写个discuz插件的发现响应是两个不同的字段。话说有没有公共api?不用传到自己号的那种 就和sm.ms主页那样,免登录 文档中提供的14ac5499cfdd2bb2859e4476d2e5b1d2bad079bf测试不可用

mrjun12 commented 4 years ago

代码中新增了 重复情况的处理。