What's the difference between router.options.routes.push and router.addRoutes? F5 refresh router problem?

Login successfully dynamic routing router.addRoutes is normal, but F5 refresh, always blank screen, read a lot of materials, login successfully saved the permission list in sessionStorage TOTAL, how to solve

in app.vue

if (Cookies.get("SIGN")) {                   
    
  this.$router.options.routes.push(JSON.parse(sessionStorage.getItem("TOTAL")))
  this.$router.addRoutes(JSON.parse(sessionStorage.getItem("TOTAL")))
}

two kinds do not work

in main.js

router.onReady(() => {
    if (sessionStorage.getItem("TOTAL")) {
         router.options.routes.push(JSON.parse(sessionStorage.getItem("TOTAL")))
         router.addRoutes(JSON.parse(sessionStorage.getItem("TOTAL")))
    }

})

nor
in router/index.js

router.beforeEach((to, from, next) => {
     router.options.routes.push(JSON.parse(sessionStorage.getItem("TOTAL")))
     router.addRoutes(JSON.parse(sessionStorage.getItem("TOTAL")))
})

can"t do it either

Oct.20,2021

this depends on how you route the information

.
Menu