Browse Source

基础代码调整

lcl 7 months ago
parent
commit
cc188f3b3b
2 changed files with 3 additions and 2 deletions
  1. 0 1
      src/router/utils.ts
  2. 3 1
      src/store/modules/user.ts

+ 0 - 1
src/router/utils.ts

@@ -303,7 +303,6 @@ function addAsyncRoutes(arrRoutes: Array<RouteRecordRaw>) {
     // 后端获取路径和前端路径相匹配
     // v.path = v.path + "/index";
     // 所有路由都需要保持
-    v.meta.keepAlive = true;
     // 将backstage属性加入meta,标识此路由为后端返回路由
     v.meta.backstage = true;
     // 父级的redirect属性取值:如果子级存在且父级的redirect属性不存在,默认取第一个子级的path;如果子级存在且父级的redirect属性存在,取存在的redirect属性,会覆盖默认值

+ 3 - 1
src/store/modules/user.ts

@@ -22,10 +22,12 @@ const formateRouter = (data, role = 1) => {
   return data.map(item => {
     return {
       path: item.path,
-      name: item.name,
+      name: item.meta.enName,
       component: null,
       meta: {
         title: item.meta.title,
+        showLink: !item.meta.isHide,
+        keepAlive: item.meta.isKeepAlive,
         icon: item.meta.icon,
         roles: [role],
         auths: item.permission