wx.uploadFile(OBJECT)在fail情况时错误提示都有那些?
发布于 5 年前 作者 xcui 17415 次浏览 来自 问答
 wx.uploadFile({
      url: 'http://example.weixin.qq.com/upload', //仅为示例,非真实的接口地址
      filePath: tempFilePaths[0],
      name: 'file',
      formData:{        'user': 'test'
      },
      success: function(res){        var data = res.data        //do something

     },

      fail:function(res_error){        

        1、"file doesn't exist"  

        2、"fail file not found"

         注:

           1、后面还有那些错误提示语?

           2、这个有没有对应的code作为判断依据?

            3、现在都是一些异常提示英文语句?是否可以加入{code:20022**,  msg:"fail file not found"}类是这样的提示方式,便于进行逻辑判断

     }



回到顶部