Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
K
kiaisoft_tuananh_nuxt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TTS Tran Viet Anh
kiaisoft_tuananh_nuxt
Commits
100f3021
Commit
100f3021
authored
Feb 01, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
onchangefile
parent
d318b797
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
index.vue
pages/posts/index.vue
+8
-2
axios.js
plugins/axios.js
+4
-4
No files found.
pages/posts/index.vue
View file @
100f3021
...
@@ -78,6 +78,7 @@
...
@@ -78,6 +78,7 @@
small-chips
small-chips
dense
dense
accept=
"image/*"
accept=
"image/*"
@
change=
"fileSelected"
/>
/>
</v-col>
</v-col>
</v-row>
</v-row>
...
@@ -410,6 +411,7 @@ export default {
...
@@ -410,6 +411,7 @@ export default {
middleware
:
[
'
web
'
],
middleware
:
[
'
web
'
],
data
:
()
=>
{
data
:
()
=>
{
return
{
return
{
file
:
null
,
dialog1
:
false
,
dialog1
:
false
,
dialog2
:
false
,
dialog2
:
false
,
title
:
''
,
title
:
''
,
...
@@ -417,7 +419,7 @@ export default {
...
@@ -417,7 +419,7 @@ export default {
content
:
''
,
content
:
''
,
user_id
:
''
,
user_id
:
''
,
status
:
null
,
status
:
null
,
images
:
null
,
images
:
[]
,
dialog
:
false
,
dialog
:
false
,
dialogDelete
:
false
,
dialogDelete
:
false
,
headers
:
[
headers
:
[
...
@@ -716,6 +718,10 @@ export default {
...
@@ -716,6 +718,10 @@ export default {
duration: 3000
duration: 3000
})
})
})
})
},
fileSelected (event) {
console.log(event)
console.log(this.images)
}
}
}
}
}
}
...
...
plugins/axios.js
View file @
100f3021
export
default
function
({
$axios
},
inject
,
redirect
)
{
export
default
function
({
$axios
},
inject
,
redirect
)
{
$axios
.
onError
(
error
=>
{
$axios
.
onError
(
(
error
)
=>
{
if
(
error
.
response
.
status
===
500
)
{
if
(
error
.
response
.
status
===
500
)
{
redirect
(
'
/500
'
)
redirect
(
'
/500
'
)
}
}
})
})
$axios
.
onError
(
error
=>
{
$axios
.
onError
(
(
error
)
=>
{
const
code
=
parseInt
(
error
.
response
&&
error
.
response
.
status
)
const
code
=
parseInt
(
error
.
response
&&
error
.
response
.
status
)
if
(
code
===
400
)
{
if
(
code
===
400
)
{
redirect
(
'
/400
'
)
redirect
(
'
/400
'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment