diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index acebbd0ea..59238d96e 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -111,7 +111,7 @@ export const constantRoutes = [ hidden: true, children: [ { - path: 'edit', + path: 'edit/:tableId(\\d+)', component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), name: 'GenEdit', meta: { title: '修改生成配置' } diff --git a/ruoyi-ui/src/views/tool/gen/editTable.vue b/ruoyi-ui/src/views/tool/gen/editTable.vue index 5f88c1a3d..fb1bba1c5 100644 --- a/ruoyi-ui/src/views/tool/gen/editTable.vue +++ b/ruoyi-ui/src/views/tool/gen/editTable.vue @@ -147,8 +147,8 @@ export default { info: {} }; }, - beforeCreate() { - const { tableId } = this.$route.query; + created() { + const tableId = this.$route.params && this.$route.params.tableId; if (tableId) { // 获取表详细信息 getGenTable(tableId).then(res => { diff --git a/ruoyi-ui/src/views/tool/gen/index.vue b/ruoyi-ui/src/views/tool/gen/index.vue index f32c7d4f1..a819f51e0 100644 --- a/ruoyi-ui/src/views/tool/gen/index.vue +++ b/ruoyi-ui/src/views/tool/gen/index.vue @@ -270,7 +270,7 @@ export default { /** 修改按钮操作 */ handleEditTable(row) { const tableId = row.tableId || this.ids[0]; - this.$router.push({ path: "/gen/edit", query: { tableId: tableId } }); + this.$router.push("/gen/edit/" + tableId); }, /** 删除按钮操作 */ handleDelete(row) {