refactor: LivstView Cabinet and Drawer can CRUD
This commit is contained in:
parent
a28bc7de6b
commit
3553164a8a
6 changed files with 183 additions and 42 deletions
|
|
@ -18,10 +18,11 @@ const router = createRouter({
|
|||
KeyCloakService.CallLogin(() => {
|
||||
const tokenAfterLogin = KeyCloakService.GetAccesToken()
|
||||
const roles = KeyCloakService.GetUserRoles()
|
||||
console.log(roles);
|
||||
|
||||
|
||||
if (tokenAfterLogin && (roles.includes('user') || roles.includes('admin')) ) {
|
||||
if (
|
||||
tokenAfterLogin &&
|
||||
(roles.includes('user') || roles.includes('admin'))
|
||||
) {
|
||||
next()
|
||||
} else {
|
||||
console.error('ไม่สามารถดึง Token หลังจากล็อกอินได้')
|
||||
|
|
@ -47,10 +48,9 @@ const router = createRouter({
|
|||
KeyCloakService.CallLogin(() => {
|
||||
const tokenAfterLogin = KeyCloakService.GetAccesToken()
|
||||
const roles = KeyCloakService.GetUserRoles()
|
||||
console.log(roles);
|
||||
|
||||
console.log(roles)
|
||||
|
||||
if (tokenAfterLogin && roles.includes('admin') ) {
|
||||
if (tokenAfterLogin && roles.includes('admin')) {
|
||||
next()
|
||||
} else {
|
||||
console.error('ไม่สามารถดึง Token หลังจากล็อกอินได้')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue