refactor: 添加登录中间件和重命名系统中间件

This commit is contained in:
wangqiao
2025-09-01 22:01:08 +08:00
parent 2c2e6f600b
commit f4312f5f0c
3 changed files with 13 additions and 6 deletions

View File

@ -0,0 +1,12 @@
import useUserStore from '~/stores/user'
export default defineNuxtRouteMiddleware((to, from) => {
const { code, state, type } = to.query
if (code && state && type && import.meta.client) {
const userStore = useUserStore()
userStore.getToken({
code: code as string,
state: state as string,
type: type as string,
})
}
})