Former-commit-id: 394df892c4488487bf5e1141b99511ab5643a8a7
Former-commit-id: 9da9e9d3027aa75981a436caeae53979d9472da8
TSXN
wanggang 5 years ago
parent 7055da3a49
commit 1233183148

@ -31,7 +31,7 @@ router.beforeEach((to, from, next) => {
} }
else { else {
if (to.path === from.path) { if (to.path === from.path) {
router.push({ path: '/router/shared/redirect.html', query: { url: to.fullUrl } }) router.push({ path: '/router/shared/redirect.html', query: { url: to.fullPath } })
} }
else { else {
next(); next();

@ -4,8 +4,8 @@
<script> <script>
export default { export default {
mounted: function () { mounted: function () {
console.log('redirect'); var url = this.$route.query.url || '/';
this.$router.push(this.$route.query.url); this.$router.push(url);
}, },
methods: { methods: {
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {

Loading…
Cancel
Save