新增加动态标题

This commit is contained in:
不做码农
2021-12-10 12:03:32 +08:00
parent 0f5f81a717
commit ac33e4f825
9 changed files with 59 additions and 32 deletions

View File

@@ -13,9 +13,10 @@ const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/demo']
router.beforeEach((to, from, next) => {
NProgress.start()
console.log('router to ' + to.path);
console.log('path=' + to.path);
if (getToken()) {
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
/* has token*/
if (to.path === '/login') {
next({ path: '/' })