每次点击菜单 会加载两次getinfo请求
设置变量hasGetInfo
let hasGetInfo = false
这里只有 hasGetInfo 为false时在动态添加路由
// 如果用户登录了 自动获取用户信息 并放在vuex中
let hasNewRoutes = false
if(token && !hasGetInfo){
let { menus } = await store.dispatch("actionGetInFo")
hasGetInfo = true
// 这里动态添加路由
hasNewRoutes = addRoutes(menus)
}