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
ac29aa6b
Commit
ac29aa6b
authored
Feb 08, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add name category + user creen post
parent
51ae5777
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
388 additions
and
465 deletions
+388
-465
auth.js
middleware/auth.js
+3
-3
web.js
middleware/web.js
+1
-1
index.vue
pages/posts/index.vue
+166
-279
index.vue
pages/products/index.vue
+200
-182
index.vue
pages/users/index.vue
+3
-0
formatTime.js
plugins/formatTime.js
+7
-0
index.js
store/index.js
+8
-0
No files found.
middleware/auth.js
View file @
ac29aa6b
export
default
function
(
context
)
{
export
default
function
(
context
)
{
console
.
log
(
'
[LOG]: middleware is running ...
'
)
console
.
log
(
'
[LOG]: middleware is running ...
'
)
}
}
middleware/web.js
View file @
ac29aa6b
export
default
({
redirect
})
=>
{
export
default
({
redirect
,
store
})
=>
{
if
(
typeof
localStorage
!==
'
undefined
'
&&
!
localStorage
.
getItem
(
'
token
'
))
{
if
(
typeof
localStorage
!==
'
undefined
'
&&
!
localStorage
.
getItem
(
'
token
'
))
{
return
redirect
(
'
/login
'
)
return
redirect
(
'
/login
'
)
}
}
...
...
pages/posts/index.vue
View file @
ac29aa6b
This diff is collapsed.
Click to expand it.
pages/products/index.vue
View file @
ac29aa6b
This diff is collapsed.
Click to expand it.
pages/users/index.vue
View file @
ac29aa6b
...
@@ -279,6 +279,9 @@ export default {
...
@@ -279,6 +279,9 @@ export default {
this
.
initialize
()
this
.
initialize
()
this
.
getUsers
()
this
.
getUsers
()
},
},
beforeCreate
()
{
// this.keepToken()
},
methods
:
{
methods
:
{
initialize
()
{
initialize
()
{
this
.
users
=
[]
this
.
users
=
[]
...
...
plugins/formatTime.js
View file @
ac29aa6b
import
Vue
from
'
vue
'
import
Vue
from
'
vue
'
import
Vuex
from
'
vuex
'
Vue
.
use
(
Vuex
)
Vue
.
mixin
({
Vue
.
mixin
({
methods
:
{
methods
:
{
...
@@ -12,6 +14,11 @@ Vue.mixin({
...
@@ -12,6 +14,11 @@ Vue.mixin({
if
(
day
.
length
<
2
)
{
day
=
'
0
'
+
day
}
if
(
day
.
length
<
2
)
{
day
=
'
0
'
+
day
}
return
[
year
,
month
,
day
].
join
(
'
-
'
)
return
[
year
,
month
,
day
].
join
(
'
-
'
)
},
keepToken
()
{
const
TOKEN
=
localStorage
.
getItem
(
'
token
'
)
this
.
$auth
.
$storage
.
setUniversal
(
'
token
'
,
TOKEN
)
}
}
}
}
})
})
store/index.js
View file @
ac29aa6b
import
Vue
from
'
vue
'
import
Vuex
from
'
vuex
'
Vue
.
use
(
Vuex
)
export
const
store
=
new
Vuex
.
Store
({
modules
:
{
}
})
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