Commit 100f3021 authored by TTS Kieu Tuan Anh's avatar TTS Kieu Tuan Anh

onchangefile

parent d318b797
......@@ -78,6 +78,7 @@
small-chips
dense
accept="image/*"
@change="fileSelected"
/>
</v-col>
</v-row>
......@@ -410,6 +411,7 @@ export default {
middleware: ['web'],
data: () => {
return {
file: null,
dialog1: false,
dialog2: false,
title: '',
......@@ -417,7 +419,7 @@ export default {
content: '',
user_id: '',
status: null,
images: null,
images: [],
dialog: false,
dialogDelete: false,
headers: [
......@@ -603,7 +605,7 @@ export default {
},
{
headers: {
'Content-Type': 'application/json; multipart/form-data; boundary=---------------------------974767299852498929531610575 ',
'Content-Type': 'application/json; multipart/form-data; boundary=---------------------------974767299852498929531610575 ',
Authorization: `Bearer ${this.$auth.$storage.getUniversal('token')}`
}
}
......@@ -716,6 +718,10 @@ export default {
duration: 3000
})
})
},
fileSelected (event) {
console.log(event)
console.log(this.images)
}
}
}
......
export default function ({ $axios }, inject, redirect) {
$axios.onError(error => {
if(error.response.status === 500) {
$axios.onError((error) => {
if (error.response.status === 500) {
redirect('/500')
}
})
$axios.onError(error => {
$axios.onError((error) => {
const code = parseInt(error.response && error.response.status)
if (code === 400) {
redirect('/400')
......@@ -22,4 +22,4 @@ export default function ({ $axios }, inject, redirect) {
// Inject to context as $api
inject('api', api)
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment