My footsteps
vue.js / 7 본문
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
'국비수업 > 수업정리' 카테고리의 다른 글
Stream API (마지막 수업😭) (0) | 2023.07.17 |
---|---|
vue.js / 6 (0) | 2023.07.13 |
vue.js / 5 (0) | 2023.07.12 |
Vue.js / 4 (0) | 2023.07.11 |
ORM (0) | 2023.07.10 |