Closed ZhangSri closed 5 years ago
我的wordpress5.0用这个插件没有这个bug
使用 WP 5.0.3, 一切正常
wordpress 5.1
The response is not a valid JSON response.
然后出现了一样不是json的问题,查看发现返回是一个array
[{"id":27,"date":"2019-03-12T15:59:02","date_gmt":"2019-03-12T07:59:02","guid":{"rendered":"http:\/\/dddd.test\/wp-content\/uploads\/2019\/03\/20150702133616_824fB.thumb_.700_0-3.jpeg"},"modified":"2019-03-12T15:59:02","modified_gmt":"2019-03-12T07:59:02","slug":"20150702133616_824fb-thumb-700_0","status":"inherit","type":"attachment","link":"http:\/\/dddd.test\/?attachment_id=27","title":{"rendered":"20150702133616_824fB.thumb.700_0"},"author":1,"comment_status":"open","ping_status":"closed","template":"","meta":[],"description":{"rendered":"<p class=\"attachment\"><a href='http:\/\/dddd-wordpress-1.oss-cn-shenzhen.aliyuncs.com\/2019\/03\/20150702133616_824fB.thumb_.700_0-3.jpeg'><img width=\"300\" height=\"300\" src=\"http:\/\/dddd-wordpress-1.oss-cn-shenzhen.aliyuncs.com\/2019\/03\/20150702133616_824fB.thumb_.700_0-3-300x300.jpeg\" class=\"attachment-medium size-medium\" alt=\"\" srcset=\"http:\/\/dddd-wordpress-1.oss-cn-shenzhen.aliyuncs.com\/2019\/03\/20150702133616_824fB.thumb_.700_0-3-300x300.jpeg 300w, http:\/\/dddd-wordpress-1.oss-cn-shenzhen.aliyuncs.com\/2019\/03\/20150702133616_824fB.thumb_.700_0-3-150x150.jpeg 150w, http:\/\/dddd-wordpress-1.oss-cn-shenzhen.aliyuncs.com\/2019\/03\/20150702133616_824fB.thumb_.700_0-3.jpeg 700w\" sizes=\"(max-width: 34.9rem) calc(100vw - 2rem), (max-width: 53rem) calc(8 * (100vw \/ 12)), (min-width: 53rem) calc(6 * (100vw \/ 12)), 100vw\" \/><\/a><\/p>\n"},"caption":{"rendered":""},"alt_text":"","media_type":"image","mime_type":"image\/jpeg","media_details":{"width":700,"height":700,"file":"2019\/03\/20150702133616_824fB.thumb_.700_0-3.jpeg","sizes":{"thumbnail":{"file":"20150702133616_824fB.thumb_.700_0-3-150x150.jpeg","width":150,"height":150,"mime_type":"image\/jpeg","source_url":"http:\/\/dddd-wordpress-1.oss-cn-shenzhen.aliyuncs.com\/2019\/03\/20150702133616_824fB.thumb_.700_0-3-150x150.jpeg"},"medium":{"file":"20150702133616_824fB.thumb_.700_0-3-300x300.jpeg","width":300,"height":300,"mime_type":"image\/jpeg","source_url":"http:\/\/dddd-wordpress-1.oss-cn-shenzhen.aliyuncs.com\/2019\/03\/20150702133616_824fB.thumb_.700_0-3-300x300.jpeg"},"full":{"file":"20150702133616_824fB.thumb_.700_0-3.jpeg","width":700,"height":700,"mime_type":"image\/jpeg","source_url":"http:\/\/dddd-wordpress-1.oss-cn-shenzhen.aliyuncs.com\/2019\/03\/20150702133616_824fB.thumb_.700_0-3.jpeg"}},"image_meta":{"aperture":"0","credit":"","camera":"","caption":"","created_timestamp":"0","copyright":"","focal_length":"0","iso":"0","shutter_speed":"0","title":"","orientation":"0","keywords":[]}},"post":26,"source_url":"http:\/\/dddd-wordpress-1.oss-cn-shenzhen.aliyuncs.com\/2019\/03\/20150702133616_824fB.thumb_.700_0-3.jpeg","_links":{"self":[{"href":"http:\/\/dddd.test\/index.php?rest_route=\/wp\/v2\/media\/27"}],"collection":[{"href":"http:\/\/dddd.test\/index.php?rest_route=\/wp\/v2\/media"}],"about":[{"href":"http:\/\/dddd.test\/index.php?rest_route=\/wp\/v2\/types\/attachment"}],"author":[{"embeddable":true,"href":"http:\/\/dddd.test\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/dddd.test\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=27"}]}}]
oss 那边上传成功,就是返回的时候格式错误了可能。具体没有细看
上传图片提示:此响应不是合法的JSON响应。
有可能是该ram账户权限没有分配oss权限, 建议把异常信息原内容显示出来方便配置解决
上传图片提示:此响应不是合法的JSON响应。