# blibli **Repository Path**: zclzy/blibli ## Basic Information - **Project Name**: blibli - **Description**: 高仿blibli移动端,仅用于内部学习测试 - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2021-02-24 - **Last Updated**: 2022-04-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # blibli ## Project setup ``` npm install 安装包 ``` ### Compiles and hot-reloads for development ``` npm run serve ``` ### Compiles and minifies for production ``` npm run build ``` ### Lints and fixes files ``` npm run lint ``` ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/). ### 登录或注册都可以放行的路由守卫 ```js router.beforeEach((to, from, next) => { const userInfo = sessionStorage.getItem('token') // 获取登录存储的数据 if (to.path === '/login' || to.path === '/reg') { // 如果当前进入页面是登录或注册就不执行任何操作,继续进入。 next() } else { // 否则判断是否存在登录存储的数据,不存在就进入登录页面 if (userInfo === null) { next('/login') } else { next() } } }) ```