wx.uploadfile 上传成功后页面会刷新
wx.uploadFile({ url: api + 'files/upload', filePath: res.tempFilePaths[i], name: 'file', header: { "content-type": "multipart/form-data", "x-auth-token": that.data.token }, success: function(res) { let data = JSON.parse(res.data); that.data.uploadFileList.push(data.path) wx.hideLoading(); }, fail: function(res) { wx.hideLoading(); wx.showToast({ title: '上传失败!', icon: 'none', duration: 1000 }) } }) |
因为这个图片上传之后会刷新页面,导致我页面上面的数据都被初始化了,这个问题请问下大家该如何解决?
