'',
success: (res) => {
// #ifdef H5 || MP-WEIXIN
const baseUrl = process.env.VUE_APP_BASE_API
// #endif
// #ifdef APP-PLUS
const baseUrl = process.env.VUE_APP_BASE_URL
// #endif
uni.uploadFile({
url: baseUrl + '/sys-storage/upload',
header: {
'Fawkes-Auth': this.getStorage('access_token')
},
filePath: res.tempFilePaths[0],
name: 'file',
success: (res) => {
if (res.statusCode !== 200) {
uni.showToast({
title: '图片上传失败',
mask: true,
icon: 'none'
})
return
}
const dataObj = JSON.parse(res.data)
if (dataObj.status) {
this.userInfo.avatarToken = dataObj.data.fileToken
} else {
uni.showToast({
title: '图片上传失败',
mask: true,
icon: 'none'
})
}
},
fail: (err) => {
uni.showToast({
title: '图片上传失败',
mask: true,
icon: 'none'
})
}
})
}
})
}···