移动设备判断
Former-commit-id: b0fcd554d934259ea58187452785c3a9a56c64a4 [formerly b0fcd554d934259ea58187452785c3a9a56c64a4 [formerly b0fcd554d934259ea58187452785c3a9a56c64a4 [formerly b0fcd554d934259ea58187452785c3a9a56c64a4 [formerly 34226601ec79c52767f74109b1813a396d2dc605 [formerly dbb1af9b0c7b60efa8f8b9f9bee8da61b3197ac3]]]]] Former-commit-id: 4a0fac504665277509d1f4a65fa63eddf170bfc1 Former-commit-id: 3666dfaef0e6eb43a62959a00832a67540a9e0df Former-commit-id: 14836b621d0f8d0b3d0982eec086fa6334afd80d [formerly 5b1ed7a7065b47fd37de6ed71db4c6b709ded728] Former-commit-id: ac7827d7b5674c7bb57764686c10f1721d4ceca7 Former-commit-id: 4bb10eb0e6081ef9556380c92a992b810936477f Former-commit-id: 12fa567115e57ce5da084eaa1cbd5e0d842f470d Former-commit-id: a927e3bc505c09154e1054d0aee79d42711570aa Former-commit-id: 8907e13de1ebe0478bc1d7776553f156e361ec37
This commit is contained in:
@@ -16,17 +16,6 @@ let router = new VueRouter({ routes })
|
||||
* 权限验证
|
||||
*/
|
||||
router.beforeEach((to, from, next) => {
|
||||
const isMobile = util.isMobile()
|
||||
// 禁止手机访问
|
||||
if (to.name !== 'is-mobile' && isMobile) {
|
||||
next({ name: 'is-mobile' })
|
||||
return
|
||||
}
|
||||
// 如果是电脑访问手机提示页面的话 -> 跳转到首页
|
||||
if (to.name === 'is-mobile' && !isMobile) {
|
||||
next({ name: 'index' })
|
||||
return
|
||||
}
|
||||
// 验证当前路由所有的匹配中是否需要有登陆验证的
|
||||
if (to.matched.some(r => r.meta.requiresAuth)) {
|
||||
// 这里暂时将cookie里是否存有token作为验证是否登陆的条件
|
||||
|
||||
Reference in New Issue
Block a user