فهرست منبع

fix gen router.js

Drew 6 سال پیش
والد
کامیت
d1af9bd529
1فایلهای تغییر یافته به همراه7 افزوده شده و 4 حذف شده
  1. 7 4
      src/main/java/com/izouma/awesomeAdmin/service/GenCodeService.java

+ 7 - 4
src/main/java/com/izouma/awesomeAdmin/service/GenCodeService.java

@@ -129,21 +129,24 @@ public class GenCodeService {
 
 
             int insertLocation = routerJs.indexOf("/**INSERT_LOCATION**/");
             int insertLocation = routerJs.indexOf("/**INSERT_LOCATION**/");
             if (insertLocation > -1) {
             if (insertLocation > -1) {
+                String remark = model.getRemark();
                 String routeName = StringUtils.capitalize(model.getClassName());
                 String routeName = StringUtils.capitalize(model.getClassName());
                 String routePath = StringUtils.uncapitalize(model.getClassName());
                 String routePath = StringUtils.uncapitalize(model.getClassName());
                 String route = "{\n                    path: '/"
                 String route = "{\n                    path: '/"
                         + routePath
                         + routePath
                         + "Edit',\n                    name: '"
                         + "Edit',\n                    name: '"
                         + routeName
                         + routeName
-                        + "Edit',\n                    component: () => import(/* webpackChunkName: \"" + routePath + "List\" */ '@/views/"
+                        + "Edit',\n                    component: () => import(/* webpackChunkName: \"" + routePath + "Edit\" */ '@/views/"
                         + routeName
                         + routeName
-                        + "Edit.vue')\n                },\n                {\n                    path: '/"
+                        + "Edit.vue'),\n                    meta: {\n                       title: '" + remark + "编辑',\n"
+                        +"                    },\n                },\n                {\n                    path: '/"
                         + routePath
                         + routePath
                         + "List',\n                    name: '"
                         + "List',\n                    name: '"
                         + routeName
                         + routeName
-                        + "List',\n                    component: () => import(/* webpackChunkName: \"" + routePath + "Edit\" */ '@/views/"
+                        + "List',\n                    component: () => import(/* webpackChunkName: \"" + routePath + "List\" */ '@/views/"
                         + routeName
                         + routeName
-                        + "List.vue')\n                }\n                ";
+                        + "List.vue'),\n                    meta: {\n                       title: '" + remark + "',\n"
+                        +"                    },\n               }\n                ";
                 boolean needComma = !routerJs.toString().substring(0, insertLocation).trim().endsWith(",");
                 boolean needComma = !routerJs.toString().substring(0, insertLocation).trim().endsWith(",");
                 if (needComma) {
                 if (needComma) {
                     routerJs.insert(routerJs.toString().substring(0, insertLocation).lastIndexOf("}") + 1, ",");
                     routerJs.insert(routerJs.toString().substring(0, insertLocation).lastIndexOf("}") + 1, ",");