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
6a0b13e8
Commit
6a0b13e8
authored
Jan 30, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lint fixed
parent
ffa01ab4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
27 deletions
+23
-27
Navbar.vue
components/Navbar.vue
+10
-12
sidebar.vue
components/sidebar.vue
+5
-9
admin.vue
layouts/admin.vue
+6
-4
web.js
middleware/web.js
+2
-2
No files found.
components/Navbar.vue
View file @
6a0b13e8
...
@@ -29,32 +29,30 @@
...
@@ -29,32 +29,30 @@
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
SideBar
from
'
@/components/SideBar
'
export
default
{
export
default
{
components
:
{
components
:
{
Side
b
ar
Side
B
ar
},
},
methods
:
{
methods
:
{
logout
()
{
logout
()
{
fetch
(
'
http://127.0.0.1:8000/api/logout
'
,
{
fetch
(
'
http://127.0.0.1:8000/api/logout
'
,
{
method
:
'
POST
'
,
method
:
'
POST
'
,
headers
:
{
headers
:
{
'
Content-Type
'
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
accept
:
'
application/json
'
,
accept
:
'
application/json
'
},
},
body
:
JSON
.
stringify
({
body
:
JSON
.
stringify
({
token
:
this
.
$auth
.
$storage
.
getUniversal
(
'
token
'
)
,
token
:
this
.
$auth
.
$storage
.
getUniversal
(
'
token
'
)
})
,
})
})
;
})
localStorage
.
setItem
(
'
token
'
,
''
)
localStorage
.
setItem
(
'
token
'
,
''
)
this
.
$auth
.
$storage
.
setUniversal
(
'
loggedIn
'
,
'
false
'
)
this
.
$auth
.
$storage
.
setUniversal
(
'
loggedIn
'
,
'
false
'
)
this
.
$auth
.
$storage
.
setUniversal
(
'
token
'
,
''
)
this
.
$auth
.
$storage
.
setUniversal
(
'
token
'
,
''
)
this
.
$auth
.
$storage
.
setUniversal
(
'
userName
'
,
''
)
this
.
$auth
.
$storage
.
setUniversal
(
'
userName
'
,
''
)
this
.
$router
.
push
(
'
/login
'
)
this
.
$router
.
push
(
'
/login
'
)
}
,
}
}
,
}
}
}
</
script
>
</
script
>
<
style
>
</
style
>
components/sidebar.vue
View file @
6a0b13e8
...
@@ -14,11 +14,7 @@
...
@@ -14,11 +14,7 @@
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'
SideBar
'
,
name
:
'
SideBar
'
,
}
data
()
{
</
script
>
<
script
>
export
default
{
data
()
{
return
{
return
{
variant
:
'
dark
'
,
variant
:
'
dark
'
,
variants
:
[
variants
:
[
...
@@ -31,9 +27,9 @@ export default {
...
@@ -31,9 +27,9 @@ export default {
'
success
'
,
'
success
'
,
'
danger
'
,
'
danger
'
,
'
warning
'
,
'
warning
'
,
'
info
'
,
'
info
'
]
,
]
}
;
}
}
,
}
}
}
</
script
>
</
script
>
layouts/admin.vue
View file @
6a0b13e8
<
template
>
<
template
>
<div>
<div>
<Nav
b
ar
/>
<Nav
B
ar
/>
<nuxt
/>
<nuxt
/>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
Nav
bar
from
'
@/components/Navb
ar
'
import
Nav
Bar
from
'
@/components/NavB
ar
'
export
default
{
export
default
{
components
:
{
Navbar
},
components
:
{
};
NavBar
}
}
</
script
>
</
script
>
middleware/web.js
View file @
6a0b13e8
export
default
({
redirect
})
=>
{
export
default
({
redirect
})
=>
{
if
(
localStorage
.
getItem
(
'
token
'
)
==
''
)
{
if
(
typeof
localStorage
!==
'
undefined
'
&&
!
localStorage
.
getItem
(
'
token
'
)
)
{
return
redirect
(
'
/login
'
)
return
redirect
(
'
/login
'
)
}
}
}
}
\ No newline at end of file
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