vue 添加版本号
router.beforeEach((to, from, next) => {if (to.meta.title) {document.title = to.meta.title}/*** 添加版本号**/if (document.URL.indexOf('?t=') < 0) {let timestamp = (new Date())....
·
router.beforeEach((to, from, next) => { if (to.meta.title) { document.title = to.meta.title } /** * 添加版本号 **/ if (document.URL.indexOf('?t=') < 0) { let timestamp = (new Date()).valueOf() window.location.href = '?t=' + timestamp + '#' + to.fullPath } if (to.meta.requireAuth) { if (getStore('personal') && getStore("loginFlag") == 1) { next(); } else { next({ path: '/login', query: {redirect: to.fullPath} }) } } else { next(); } });
更多推荐
已为社区贡献5条内容
所有评论(0)