|
@@ -60,9 +60,6 @@ function txUploadFile(file){
|
|
|
}
|
|
}
|
|
|
tools.showLoading()
|
|
tools.showLoading()
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
|
- console.log('cos-*-------------------------',cos)
|
|
|
|
|
- console.log(file)
|
|
|
|
|
- console.log('/app-serve/'+tools.getDate()+tools.getRandFileName(file))
|
|
|
|
|
// 分片上传文件
|
|
// 分片上传文件
|
|
|
cos.postObject({
|
|
cos.postObject({
|
|
|
Bucket: Bucket,
|
|
Bucket: Bucket,
|
|
@@ -77,9 +74,15 @@ function txUploadFile(file){
|
|
|
},
|
|
},
|
|
|
}, function (err, data) {
|
|
}, function (err, data) {
|
|
|
tools.hideLoading()
|
|
tools.hideLoading()
|
|
|
- console.log(err, data);
|
|
|
|
|
if(data.Location!==undefined){
|
|
if(data.Location!==undefined){
|
|
|
- data.Location='https://'+data.Location+'?imageMogr2/quality/50';
|
|
|
|
|
|
|
+ let suffixArr = ['.pdf', '.doc', '.docx', '.xlsx', '.xls','.mp4']
|
|
|
|
|
+ let suffix = data.Location.substring(data.Location.lastIndexOf("."));
|
|
|
|
|
+ let suffixKey = suffixArr.indexOf(suffix)
|
|
|
|
|
+ if (suffixKey < 0){
|
|
|
|
|
+ data.Location='https://'+data.Location+'?imageMogr2/quality/50';
|
|
|
|
|
+ }else {
|
|
|
|
|
+ data.Location='https://'+data.Location;
|
|
|
|
|
+ }
|
|
|
resolve( data)
|
|
resolve( data)
|
|
|
}else {
|
|
}else {
|
|
|
resolve( false)
|
|
resolve( false)
|