优化代码
This commit is contained in:
parent
eebd0c3891
commit
f78037103d
@ -15,7 +15,7 @@ const whiteList = ['/login', '/register', '/social-callback'];
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
NProgress.start();
|
||||
if (getToken()) {
|
||||
to.meta.title && useSettingsStore().setTitle(to.meta.title as string);
|
||||
to.meta.title && useSettingsStore().setTitle(to.meta.title);
|
||||
/* has token*/
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' });
|
||||
|
4
src/types/router.d.ts
vendored
4
src/types/router.d.ts
vendored
@ -1,6 +1,10 @@
|
||||
import { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
declare module 'vue-router' {
|
||||
interface RouteMeta {
|
||||
title: string;
|
||||
}
|
||||
|
||||
declare type RouteOption = {
|
||||
hidden?: boolean;
|
||||
permissions?: string[];
|
||||
|
Loading…
x
Reference in New Issue
Block a user