登路后跳入退出前的路由
next(`/login?redirect=${to.path}`)
login
watch: { $route: { handler(route) { this.redirect = (route.query && route.query.redirect) || '/' }, immediate: true, }, },
登录后跳
const routerPath = this.redirect === '/404' || this.redirect === '/401' ? '/' : this.redirect this.$router.push(routerPath).catch(() => {})