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(() => {})