|
@@ -248,6 +248,7 @@ import {
|
|
opt = {};
|
|
opt = {};
|
|
opt.url = url;
|
|
opt.url = url;
|
|
}
|
|
}
|
|
|
|
+ let token = uni.getStorageSync('token')
|
|
let count = opt.count || 1,
|
|
let count = opt.count || 1,
|
|
sizeType = opt.sizeType || ['compressed'],
|
|
sizeType = opt.sizeType || ['compressed'],
|
|
sourceType = opt.sourceType || ['album', 'camera'],
|
|
sourceType = opt.sourceType || ['album', 'camera'],
|
|
@@ -259,11 +260,13 @@ import {
|
|
sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有
|
|
sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有
|
|
sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有
|
|
sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有
|
|
success: function(res) {
|
|
success: function(res) {
|
|
- console.log()
|
|
|
|
|
|
+ console.log('----',res)
|
|
|
|
+ console.log('token',token)
|
|
//启动上传等待中...
|
|
//启动上传等待中...
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title: '图片上传中',
|
|
title: '图片上传中',
|
|
});
|
|
});
|
|
|
|
+ console.log('----url',HTTP_REQUEST_URL + '/api/' + uploadUrl)
|
|
uni.uploadFile({
|
|
uni.uploadFile({
|
|
url: HTTP_REQUEST_URL + '/api/' + uploadUrl,
|
|
url: HTTP_REQUEST_URL + '/api/' + uploadUrl,
|
|
filePath: res.tempFilePaths[0],
|
|
filePath: res.tempFilePaths[0],
|
|
@@ -275,7 +278,7 @@ import {
|
|
// #ifdef MP
|
|
// #ifdef MP
|
|
"Content-Type": "multipart/form-data",
|
|
"Content-Type": "multipart/form-data",
|
|
// #endif
|
|
// #endif
|
|
- [TOKENNAME]: 'Bearer ' + store.state.app.token
|
|
|
|
|
|
+ [TOKENNAME]: 'Bearer ' + token
|
|
},
|
|
},
|
|
success: function(res) {
|
|
success: function(res) {
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|