这个是我之前的一个统计代码, 我用的是 cnzz, 百度统计差不多, 也有相应的接口, 可查看文档 router.beforeEach((to, from, next) => { // 设置 标题 document.title = to.meta.title || ''; // // 统计代码 // if(from.name) { // _czc.push(['_trackPageview' // , '/#' + to.fullPath // , window.location.origin + '/#' + from.fullPath]); // }else { // _czc.push(['_trackPageview' // , '/#' + to.fullPath] // , ''); // } // 登录权限验证 if(to.meta.auth && !UserLogic.isLogin()) { MSG.error('登录失效,请重新登录!'); router.replace({name: 'login'}); }else { next(); } });
这个是我之前的一个统计代码, 我用的是 cnzz, 百度统计差不多, 也有相应的接口, 可查看文档