|
|
@@ -123,7 +123,7 @@
|
|
|
|
|
|
<script>
|
|
|
import FilePondUpload from '@/components/upload/filepond-upload.vue'
|
|
|
-import { videoCategory } from '@/api/media/video'
|
|
|
+import { videoCategory, submitVideoPost } from '@/api/media/video'
|
|
|
export default {
|
|
|
components: {
|
|
|
FilePondUpload
|
|
|
@@ -173,32 +173,26 @@ export default {
|
|
|
this.showMessage = true
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
if (this.videoInfo.tags.length > 6) {
|
|
|
this.message = '标签超过6个'
|
|
|
this.showMessage = true
|
|
|
return
|
|
|
}
|
|
|
- fetch(`/api/media/video/submit`, {
|
|
|
- headers: {
|
|
|
- 'Content-Type': 'application/json; charset=UTF-8',
|
|
|
- 'X-XSRF-TOKEN': this.$cookies.get('XSRF-TOKEN')
|
|
|
- },
|
|
|
- method: 'POST',
|
|
|
- credentials: 'include',
|
|
|
- body: JSON.stringify(this.videoInfo)
|
|
|
- }).then(response => response.json())
|
|
|
- .then(json => {
|
|
|
- if (json.code === 0) {
|
|
|
+
|
|
|
+ submitVideoPost(this.videoInfo)
|
|
|
+ .then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
this.message = '投稿成功,等待审核通过后你就可以看到你的视频了'
|
|
|
this.showMessage = true
|
|
|
this.$router.push('/studio')
|
|
|
} else {
|
|
|
- this.message = json.msg
|
|
|
+ this.message = res.msg
|
|
|
this.showMessage = true
|
|
|
}
|
|
|
})
|
|
|
- .catch(e => {
|
|
|
- return null
|
|
|
+ .catch(error => {
|
|
|
+ this.$message.error(error.message)
|
|
|
})
|
|
|
},
|
|
|
setFile(value) {
|