Former-commit-id: 9aa2487c1a5dd2a6b347268355d27d60937b1a15 [formerly 9aa2487c1a5dd2a6b347268355d27d60937b1a15 [formerly 9aa2487c1a5dd2a6b347268355d27d60937b1a15 [formerly 9aa2487c1a5dd2a6b347268355d27d60937b1a15 [formerly 4fa88c73d67fe113cdb9d5038baa61b9a2c50ac7 [formerly c1e1986deb2c50ecfff8f94c7e0af65b83777426]]]]]
Former-commit-id: 9ebe6124d8e9c0c91b8bbe32aff66f3c1892ba25
Former-commit-id: b32951098db0ae68c5b37e50bf7aedcc7c27c66e
Former-commit-id: f1577d9b650588c3a9d3083568face8219d867a3 [formerly e0a70087dcc7303505a1a21579dcbc313e953e22]
Former-commit-id: 1066bacc4e3b7211be367b7514994cbba041459f
Former-commit-id: c29f02c0c65173cf9b260c9c4e73a65e99a692ab
Former-commit-id: 9d2a3a8f99dfb8bdff9b665c45de5f0d2de9a7db
Former-commit-id: 41ac0283e997d7e392459d8d86544c822f5ac148
Former-commit-id: c59d4019d3b1f5454394cae4587d6653b616a978
This commit is contained in:
liyang
2018-07-20 18:24:47 +08:00
parent 1b62022beb
commit 5d15b31f48
10 changed files with 44 additions and 46 deletions

View File

@@ -16,13 +16,14 @@ let router = new VueRouter({ routes })
* 权限验证
*/
router.beforeEach((to, from, next) => {
const isMobile = util.isMobile()
// 禁止手机访问
if (to.name !== 'is-mobile' && util.isMobile()) {
if (to.name !== 'is-mobile' && isMobile) {
next({ name: 'is-mobile' })
return
}
// 如果是电脑访问 is-mobile 页面的话 -> 跳转到首页
if (to.name === 'is-mobile' && !util.isMobile()) {
// 如果是电脑访问手机提示页面的话 -> 跳转到首页
if (to.name === 'is-mobile' && !isMobile) {
next({ name: 'index' })
return
}

View File

@@ -1 +1 @@
bf5a89a4f0f25ee326691f3c72601d638bb047cf
97be3f2fd593b87cf9c7a68081ce40feb76f9c1b