c***@163.com
c***@163.com
  • 发布:2018-10-28 23:11
  • 更新:2019-08-15 11:02
  • 阅读:1291

大家好,mui上传单图片,responseText里面一直是空,但是status是200

分类:HTML5+

如题,请问这是什么原因,谢谢。
{"UUID":"uploader111540733433249","url":"http://192.168.1.102/api/home/setting/upload","options":{"method":"POST","blocksize":2048000,"priority":100},"uploadedSize":18,"totalSize":0,"responseText":"{\"attributes\":{},\"request\":{},\"query\":{},\"server\":{},\"files\":{},\"cookies\":{},\"headers\":{}}","method":"POST","timeout":120,"retry":3,"retryInterval":30,"priority":100,"eventHandlers":{},"requestHeaders":{},"responseHeaders":null,"noParseResponseHeader":null,"cacheReponseHeaders":{},"state":4}

function uploadify() {  

                console.log('==== 准备上传 ======');  
                plus.gallery.pick(function(path) {  
                    // mui.toast(path);  
                    //showImg( path );  
                    //createItem(path);  
                    console.log(path);  
                    upload(path);  
                    // console.log(filepath);  
                }, function(e) {  
                    mui.toast('取消图片选择');  
                }, {  
                    filter: 'image'  
                });  

            }  

            function upload(path) {  

                console.log('==== 图片:' + path + '=================')  
                var task = plus.uploader.createUpload("http://192.168.1.102/api/home/setting/upload", {  
                        method: "POST",  
                        blocksize: 2048000,  
                        priority: 100  
                    },  
                    function(t, status) {  

                        console.log('===== 完成 ======\n');  
                        // 上传完成  
                        if (status == 200) {  
                            alert("Upload success: " + t.url);  
                            // console.log(JSON.stringify(t));  
                        } else {  
                            // console.log(JSON.stringify(t));  
                            alert("Upload failed: " + status);  
                        }  
                        console.log(JSON.stringify(t) + '\n');  
                        console.log(JSON.stringify(t.responseText));  

                        // console.log(r);  
                        // console.log(status);  
                    }  
                );  

                task.addFile('images/icon_commentphoto.jpg', {  
                    key: "file"  
                });  
                task.start();  

            }
2018-10-28 23:11 负责人:无 分享
已邀请:
c***@163.com

c***@163.com

这个文件解决了么?

9***@qq.com

9***@qq.com - ......

你打印code试试

该问题目前已经被锁定, 无法添加新回复