|
|
@@ -118,6 +118,7 @@
|
|
|
<script>
|
|
|
import { getServerInfo } from '@/api/content'
|
|
|
import { videoRegion, addVideoPost } from '@/api/video'
|
|
|
+import {getVideoChannelInfo} from "@/api/file";
|
|
|
|
|
|
export default {
|
|
|
name: 'PublishVideo',
|
|
|
@@ -165,6 +166,41 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ getVideoChannelInfo().then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ const resData = res.data
|
|
|
+ this.options = {
|
|
|
+ target: resData.ossUrl,
|
|
|
+ chunkSize: resData.maxSize,
|
|
|
+ fileParameterName: 'file',
|
|
|
+ testChunks: false,
|
|
|
+ query: (file, chunk) => {
|
|
|
+ return {
|
|
|
+ channelId: this.form.channelId
|
|
|
+ }
|
|
|
+ },
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + resData.token
|
|
|
+ },
|
|
|
+ withCredentials: false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: '获取 OSS 服务器地址失败, 暂时无法上传视频文件',
|
|
|
+ type: 'error',
|
|
|
+ duration: 3000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: '获取 OSS 服务器地址失败, 暂时无法上传视频文件',
|
|
|
+ type: 'warning',
|
|
|
+ duration: 3000
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
getServerInfo(this.form.channelId).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
const resData = res.data
|