cookie集中操作

Former-commit-id: 8c9ffb88b27e70269f09b1852909e92cfd710cb7 [formerly 8c9ffb88b27e70269f09b1852909e92cfd710cb7 [formerly 8c9ffb88b27e70269f09b1852909e92cfd710cb7 [formerly 8c9ffb88b27e70269f09b1852909e92cfd710cb7 [formerly e5bdcb60efe550ac396d216da0923446cdca81ee [formerly 90e1fddc055b36525405a7695e9bc7a405d98b2c]]]]]
Former-commit-id: 87867694606f8fe71fcb25c91d7089adbd959561
Former-commit-id: 9716af31042f2d63dbba236a23dc4119cfcf79c1
Former-commit-id: 22fbf4d4b11e94f88dd33c1d0ae289035e728c60 [formerly f8efa89704beb40194d90c947339377461142f60]
Former-commit-id: 15f9f81d6d4a65c6bf37e0609b0b9015778121ab
Former-commit-id: 410cc0bf083d3101c9b689d2a6e411224dfd2228
Former-commit-id: 474c050e0bb843faf13e525ef3fe141482d36fee
Former-commit-id: 947277bfe634f10563da40a6205bf69b3056f06f
Former-commit-id: cceb89e9afd1516fb3378d3edcbfca97cbaa0ffe
This commit is contained in:
liyang
2018-07-24 11:02:51 +08:00
parent 2baf1231fb
commit 35d1e3b755
7 changed files with 44 additions and 27 deletions

View File

@@ -19,7 +19,7 @@ router.beforeEach((to, from, next) => {
if (to.matched.some(r => r.meta.requiresAuth)) {
// 这里暂时将cookie里是否存有token作为验证是否登陆的条件
// 请根据自身业务需要修改
const token = util.cookieGet('token')
const token = util.cookies.get('token')
if (token && token !== 'undefined') {
next()
} else {