|
@@ -52,10 +52,14 @@ export default {
|
|
|
file.filePaths.forEach((filePath, index) => {
|
|
|
if (isCloud) {
|
|
|
const fileArr = filePath.split('.')
|
|
|
+
|
|
|
+ const fileType = file.tempFiles[index].type || 'image/png'
|
|
|
+ const suffix = fileArr.length >= 2 ? fileArr[fileArr.length - 1] : fileType.split('/')[1]
|
|
|
+
|
|
|
uploadArr.push(this.uploadCloud({
|
|
|
filePath,
|
|
|
- cloudPath: this.uuid() + '.' + fileArr[fileArr.length - 1],
|
|
|
- fileType: (methods === 'chooseImage' ? 'image/' : 'video/') + fileArr[fileArr.length - 1]
|
|
|
+ cloudPath: this.uuid() + '.' + suffix,
|
|
|
+ fileType: (methods === 'chooseImage' ? 'image/' : 'video/') + suffix
|
|
|
}).then(res => {
|
|
|
if (res.success) {
|
|
|
return {
|
|
@@ -121,12 +125,4 @@ export default {
|
|
|
chooseAndUploadVideo(chooseParam, uploadParam, isCloud) {
|
|
|
return this.chooseAndUpload('chooseVideo',chooseParam, uploadParam, isCloud)
|
|
|
},
|
|
|
- authLogin(cb) {
|
|
|
- if (!uni.getStorageSync('token')) {
|
|
|
- return uni.navigateTo({
|
|
|
- url: '/modules/common/login/login'
|
|
|
- })
|
|
|
- }
|
|
|
- cb && cb()
|
|
|
- }
|
|
|
}
|