file upload
This commit is contained in:
parent
6d8a409bdd
commit
98b7e2817c
@ -95,9 +95,10 @@ export default {
|
|||||||
await this.$store.dispatch('media/getTree', path)
|
await this.$store.dispatch('media/getTree', path)
|
||||||
},
|
},
|
||||||
|
|
||||||
onSubmit (evt) {
|
async onSubmit (evt) {
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
console.log(this.inputFile)
|
await this.$store.dispatch('auth/inspectToken')
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
onUploadProgress: (progressEvent) => {
|
onUploadProgress: (progressEvent) => {
|
||||||
const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
|
const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
|
||||||
@ -106,7 +107,11 @@ export default {
|
|||||||
headers: { Authorization: 'Bearer ' + this.$store.state.auth.jwtToken }
|
headers: { Authorization: 'Bearer ' + this.$store.state.auth.jwtToken }
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$axios.put('/upload/?path=/ffplayout/test.mp4', this.inputFile, config)
|
this.$axios.put(
|
||||||
|
`/upload/${encodeURIComponent(this.inputFile.name)}?path=${encodeURIComponent(this.crumbs.map(e => e.text).join('/'))}`,
|
||||||
|
this.inputFile,
|
||||||
|
config
|
||||||
|
)
|
||||||
.then(res => console.log(res))
|
.then(res => console.log(res))
|
||||||
.catch(err => console.log(err))
|
.catch(err => console.log(err))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user