Invalid vue addRouters refresh problem

read all over the Internet, none of those shared is valid!
the default front end only writes the following routes, and the rest is given to the data by the back end, and then addRouters.

 {
    path: "/login",
    name: "login",
    meta: {
      title: "Login - ",
      hideInMenu: true
    },
    component: () => import("@/view/login/login.vue")
  },
  {
    path: "/",
    name: "root",
    redirect: "/home",
    component: Main,
    meta: {
      title: "",
      hideInMenu: true,
      notCache: true
    },
    children: [
      {
        path: "/home",
        name: "home",
        meta: {
          title: "",
          hideInMenu: true,
          notCache: true
        },
        component: () => import("@/view/single-page/home")
      }
    ]
  },

after logging in, addRouters:

  let resultRoute = makeRoute(target[0].children)

          this.$router.options.routes.push(...resultRoute)
          this.$router.addRoutes(resultRoute)

however, except that the default / home can be refreshed. Other addresses, refresh, are stuck on the page, no response.

clipboard.png


router

clipboard.png

everything. I"m speechless. Pray for the great god.


self-question and answer:

//  : 
if (store.state.user.token) {
  let resultRoute = makeRoute(store.state.app.menuAuthList[0].children)
  router.options.routes.push(...resultRoute)
  router.addRoutes(resultRoute)
}

router.beforeEach((to, from, next) => {}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1beb524-30dc7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1beb524-30dc7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?