优化
This commit is contained in:
parent
317fee3c92
commit
4182fa23ed
@ -61,3 +61,13 @@ router.afterEach(async () => {
|
|||||||
|
|
||||||
await store.dispatch('GET_DEPLIST')
|
await store.dispatch('GET_DEPLIST')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
router.onError((error) => {
|
||||||
|
const pattern = /Loading chunk (\d)+ failed/g
|
||||||
|
console.log('xcq --- pattern: ', pattern)
|
||||||
|
const isChunkLoadFailed = error.message.match(pattern)
|
||||||
|
const targetPath = router.history.pending.fullPath
|
||||||
|
if (isChunkLoadFailed) {
|
||||||
|
router.replace(targetPath)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user