Error load

This commit is contained in:
saplf
2019-09-06 15:45:28 +08:00
parent b700f76d27
commit 8d6cd7a46f

View File

@@ -1,10 +1,13 @@
export const dva = { export const dva = {
config: { config: {
onError(err: ErrorEvent) { onError(err: ErrorEvent | any) {
err.preventDefault(); err.preventDefault();
// tslint:disable-next-line: no-console // tslint:disable-next-line: no-console
console.error(err.message); console.error(err.message);
if (err.name === 'ChunkLoadError') {
location.reload();
}
}, },
}, },
}; };