|
@@ -140,4 +140,16 @@ const router = new VueRouter({
|
|
|
routes
|
|
|
})
|
|
|
|
|
|
+if (process.env.NODE_ENV === 'production') {
|
|
|
+ // 强制每次都从首页进入
|
|
|
+ router.beforeEach((to, from, next) => {
|
|
|
+ console.log(to, from, next)
|
|
|
+ if (!from.name && to.name !== 'HomeView') {
|
|
|
+ next('/')
|
|
|
+ } else {
|
|
|
+ next()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
export default router
|