Fix/fast change directory (#43)

* fix:fast changing directory issue

* fix baseURL is not included
pull/739/head
helloray 2018-12-05 19:25:26 +08:00 committed by Henrique Dias
parent 218e638f88
commit 7e1d745435
1 changed files with 1 additions and 0 deletions

View File

@ -144,6 +144,7 @@ export default {
api.fetch(url) api.fetch(url)
.then((req) => { .then((req) => {
if (this.$store.state.baseURL + req.url !== window.location.pathname) return
if (!url.endsWith('/') && req.url.endsWith('/')) { if (!url.endsWith('/') && req.url.endsWith('/')) {
window.history.replaceState(window.history.state, document.title, window.location.pathname + '/') window.history.replaceState(window.history.state, document.title, window.location.pathname + '/')
} }