| | |
| | | id: '', |
| | | title: '', |
| | | videoFileKey: '', |
| | | videoDuration: 0, |
| | | videoFit: 'cover', |
| | | goodsId: '', |
| | | tags: [], |
| | |
| | | }, |
| | | methods: { |
| | | // 获取推荐标签 |
| | | getRecommendTags(type) { |
| | | async getRecommendTags(type) { |
| | | const params = { |
| | | tagName: this.tagInput.trim(), |
| | | searchType: type |
| | |
| | | console.log("执行了"); |
| | | // 调用后端获取sts临时访问凭证 |
| | | getSTSToken().then(res => { |
| | | console.log(res, "sts结构"); |
| | | const COS = require('@/lib/cos-wx-sdk-v5.js'); // 开发时使用 |
| | | // const COS = require('./lib/cos-wx-sdk-v5.min.js'); // 上线时使用压缩包 |
| | | |
| | |
| | | if(fileName.indexOf('%') > -1) { |
| | | fileName = decodeURIComponent(fileName); |
| | | } |
| | | const fileKey = getFileKey(fileName); |
| | | this.videoInfo = { |
| | | url: res.tempFilePath, |
| | | fileKey: fileKey, |
| | | fileType: fileKey.split('/')[0], |
| | | fileSize: res.size, |
| | | originalFileName: fileName, |
| | | cover: '' |
| | | }; |
| | | this.formData.videoFileKey = fileKey; |
| | | // 判断视频的填充模式 |
| | | this.formData.videoFit = this.calculateVideoFit(res.width, res.height) |
| | | const fileKey = getFileKey(fileName); |
| | | this.videoInfo = { |
| | | url: res.tempFilePath, |
| | | fileKey: fileKey, |
| | | fileType: fileKey.split('/')[0], |
| | | fileSize: res.size, |
| | | originalFileName: fileName, |
| | | cover: '' |
| | | }; |
| | | this.formData.videoFileKey = fileKey; |
| | | this.formData.videoDuration = res.duration; |
| | | // 判断视频的填充模式 |
| | | this.formData.videoFit = this.calculateVideoFit(res.width, res.height) |
| | | |
| | | this.cosClient.uploadFile({ |
| | | this.cosClient.uploadFile({ |
| | | Bucket: this.bucket, |
| | | Region: this.region, |
| | | Key: fileKey, |
| | |
| | | title: '', |
| | | videoFileKey: '', |
| | | videoFit: 'cover', |
| | | videoDuration: 0, |
| | | goodsId: '', |
| | | tags: [], |
| | | fileInfo: {} |