删除无用代码

Former-commit-id: df7ea6ac913379715f2f09d315ecaf2239f0fda8 [formerly df7ea6ac913379715f2f09d315ecaf2239f0fda8 [formerly df7ea6ac913379715f2f09d315ecaf2239f0fda8 [formerly df7ea6ac913379715f2f09d315ecaf2239f0fda8 [formerly 43e9755f8a40182dbaa6027312e2d9c0f1331751 [formerly 7d0dff3a621b3d47360c1c377358b1885760554d]]]]]
Former-commit-id: 727098e5f0103c313095ceb4ba4bda94ea0c6a7a
Former-commit-id: 98089e778a3662b230cd01cbb629b9563b88a9de
Former-commit-id: 089dc81d6836db8550e9c8f4130762735c5c368f [formerly ef6182ea0ad02d3c4281662bd4fd928cf1fea15e]
Former-commit-id: ea7551c3a2e625ebe701d32bba61810caa80bc2c
Former-commit-id: e6400de2d11fe05b10c71aa902d44e98c38fb540
Former-commit-id: d1317bace9081918e1cf1c6e64b3f71efef6c38b
Former-commit-id: 9baeb1b1fa6d4ab143b21e7d22c84ea3bfb69fa3
Former-commit-id: 5da47a5c01d745786f04aee341a62de577299028
This commit is contained in:
liyang
2018-07-17 16:38:59 +08:00
parent 74d1896955
commit 7fdc1327db
7 changed files with 37 additions and 29 deletions

View File

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