// 引入路由 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) => { return to.path.includes(item.path) }); settingStore.setuseIndex(index) document.title = `教学一体化-${to.meta.title}` next() })