Vuerouter problem, single page refresh or direct input path does not trigger beforeEach

  node.js, question
# Route inside has auth attribute set
 'name': 'manage'
 'auth': true
 'component': require './components/user-manage.vue'
 # beforeeach inside authentication auth jumps to login page
 # But refreshing the page (at this time the route is /manage) did not trigger the jump of this function, nor did the input address of a new page (directly displaying the contents of the/manage route component)
 router.beforeEach (transition) ->
 # detect cookie authentication jump

Well, it’s been settled

I put router.beforeEach at the end of the file.
Just put it in front of router.start

router.beforeEach (transition) ->
 #   ...
 routerMap router
 router.start App, '#app'