국비수업/수업정리
vue.js / 7
밀김
2023. 7. 14. 15:25
728x90
beforeEnter:(to,from,next)=>{
console.log("test");
}
- 인증권한
path: '/admin',
component: Layout, // admin루트로 가는 것
children:[
{path: 'index', component:AdminIndex},
{path: 'menu/list',component:AdminMenuList}
], beforeEnter: (to, from, next) => { // 칠드런 들어가기전에 나 실행시키고가
console.log("test");
if (userDetails.isAnonymous()) { //피니아 설정해줘야 유저디테일스 사용가능
next("/sign-in");
return;
}
if(userDetails.hasAnyRole("admin")){
next("/error403");
return;
}
next(); // 가던 길 가세요
}
- 서버는 데이터만 제공 인증은 클라이언트가 한다
- 비크립트(?) 설치
npm i bcryptjs
- 구글 클라우드 플랫폼에서 기본 설정들을 하면 됨
728x90