前台代码:
bindPhoto(e) {
var that =
this;
wx.chooseImage({
count:
1,
sizeType: [
'original',
'compressed'],
// 指定原图或者压缩图
sourceType: [
'album',
'camera'],
// 指定图片来源
success:
function (res) {
var tempFilePaths = res.tempFilePaths;
wx.uploadFile({
url:
'http://192.168.31.111:8007/goods/wx_upload.do',
filePath: tempFilePaths[
0],
name:
'file',
header: {
"Content-Type":
"multipart/form-data" },
formData:{
'session_token': token
},
success:
function(res){
var cur_data = res.data;
console.log