<template>
    <div>正在处理...</div>
</template>
<script>
    const Qs = require('qs');
    export default {
        beforeRouteEnter(to, from, next) {
            console.log(from, '来自哪里')
            let path = ''
            if (from.fullPath.indexOf('?') != -1) {
                path = from.fullPath.split('?')[0]
            } else {
                path = from.fullPath
            }

            next(vm => {

                let str = Qs.stringify(vm.$route.query)
                vm.$router.replace({
                    path: path + '?' + str
                })
            })
        }
    }
</script>