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