You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
442 B
12 lines
442 B
8 months ago
|
// 引入路由
|
||
|
import router from '@/router/index'
|
||
|
import pinia from './store'
|
||
|
import { constRouter } from '@/router/module/constRouter'
|
||
|
import useSettingStore from '@/store/module/setting'
|
||
|
const settingStore = useSettingStore(pinia) //重新指向pinia仓储
|
||
|
router.beforeEach((to, from, next) => {
|
||
|
let index = constRouter[0].children.findIndex((item:any) => item.name === to.name);
|
||
|
settingStore.setuseIndex(index)
|
||
|
next()
|
||
|
})
|