|
@@ -123,6 +123,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import FilePondUpload from '@/components/upload/filepond-upload.vue'
|
|
import FilePondUpload from '@/components/upload/filepond-upload.vue'
|
|
|
|
|
+import { videoCategory } from '@/api/media/video'
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
FilePondUpload
|
|
FilePondUpload
|
|
@@ -158,7 +159,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.getCategoryList()
|
|
|
|
|
|
|
+ this.getVideoCategory()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
publish() {
|
|
publish() {
|
|
@@ -262,24 +263,26 @@ export default {
|
|
|
return null
|
|
return null
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- getCategoryList() {
|
|
|
|
|
- fetch(`/api/media/video/category`, {
|
|
|
|
|
- headers: {
|
|
|
|
|
- 'Content-Type': 'application/json; charset=UTF-8',
|
|
|
|
|
- 'X-XSRF-TOKEN': this.$cookies.get('XSRF-TOKEN')
|
|
|
|
|
- },
|
|
|
|
|
- method: 'GET',
|
|
|
|
|
- credentials: 'include'
|
|
|
|
|
- }).then(response => response.json())
|
|
|
|
|
- .then(json => {
|
|
|
|
|
- for (let i = 0; i < json.data.length; i++) {
|
|
|
|
|
- const name = json.data[i].name
|
|
|
|
|
- this.category.push(name)
|
|
|
|
|
- this.categoryMap.Set(name, json.data[i])
|
|
|
|
|
|
|
+ getVideoCategory() {
|
|
|
|
|
+ videoCategory()
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
|
+ for (let i = 0; i < res.data.length; i++) {
|
|
|
|
|
+ const name = res.data[i].name
|
|
|
|
|
+ this.category.push(name)
|
|
|
|
|
+ this.categoryMap.Set(name, res.data[i])
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$notify({
|
|
|
|
|
+ title: res.code,
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ duration: 500
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- .catch(e => {
|
|
|
|
|
- return null
|
|
|
|
|
|
|
+ .catch(error => {
|
|
|
|
|
+ this.$message.error(error.message)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
getCategory(name) {
|
|
getCategory(name) {
|