Browse Source

报500 test fix

baichengfei 5 years ago
parent
commit
c623346c8c
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/dashoo.cn/frontend_web/src/layouts/error.vue

+ 7 - 0
src/dashoo.cn/frontend_web/src/layouts/error.vue

@@ -14,11 +14,18 @@
 export default {
   name: 'nuxt-error',
   props: ['error'],
+  created () {
+    if (this.error.statusCode === 500 && /^Loading chunk (\d)+ failed\./.test(this.error.message)) {
+      console.log('Loading chunk113333333333333333333331')
+      this.$router.replace('/')
+    }
+  },
   head () {
     return {
       title: this.error.message || 'An error occurred'
     }
   }
+
 }
 </script>