getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia) 1.在vue3中路由守卫里面使用pinia时报错 在钩子函数外,pinia 还没有被挂载,但是在前置守卫函数中,pinia 已经被挂载了,所以获取全局状态,需要在钩子函数中进行,正确的实现如下