From 9fa02a7b603f1f7a117e8590af4ea4ff12376465 Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Wed, 18 Jul 2018 11:18:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=98=AF=E7=94=B5=E8=84=91?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=20is-mobile=20=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E8=AF=9D=20=E8=B7=B3=E8=BD=AC=E5=88=B0=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: b69892d584c0d90e74afc65f3a0f5aa72d7a8902 [formerly b69892d584c0d90e74afc65f3a0f5aa72d7a8902 [formerly b69892d584c0d90e74afc65f3a0f5aa72d7a8902 [formerly b69892d584c0d90e74afc65f3a0f5aa72d7a8902 [formerly c96c92f194844b48a638d03aea3c3f841a2d4ae0 [formerly 02b02df6ba1d89008d69fb1c029279863b039845]]]]] Former-commit-id: 7e9989ba1ce54e84804ff3de09dba15d7260222b Former-commit-id: 3b964378c169dcbe2f9aeaae639ee6120f2f5451 Former-commit-id: 1d2b7d44b33c568d02a42b510b50f8592c2d2c06 [formerly 88d3c50c4664c178e310ec482bfc29c1927922ad] Former-commit-id: c65f5b27cf2c5ac2c4dbdbc746cd76e7ef61fbb1 Former-commit-id: 792eab1a332813861f486bebadcc759ed2f94fa0 Former-commit-id: 2f2aac48b2895a16071d09a0842e0aacff16d272 Former-commit-id: 28f2651336d25e04d944c3fdd42cd3f1ce3e8a0f Former-commit-id: 7195e2683708e918a446774c22949d59d5e125b0 --- src/router/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/router/index.js b/src/router/index.js index 13d4a128..8a1f50c4 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -21,6 +21,11 @@ router.beforeEach((to, from, next) => { next({ name: 'is-mobile' }) return } + // 如果是电脑访问 is-mobile 页面的话 跳转到首页 + if (to.name === 'is-mobile' && !util.isMobile()) { + next({ name: 'index' }) + return + } // 验证当前路由所有的匹配中是否需要有登陆验证的 if (to.matched.some(r => r.meta.requiresAuth)) { // 这里暂时将cookie里是否存有token作为验证是否登陆的条件