diff --git a/admin-web/src/models/admin/roleList.js b/admin-web/src/models/admin/roleList.js index fcec9a9b7..1b8b97e8f 100644 --- a/admin-web/src/models/admin/roleList.js +++ b/admin-web/src/models/admin/roleList.js @@ -101,7 +101,6 @@ export default { *roleAssignResource({ payload }, { call }) { const { id, resourceIds, roleTreeData } = payload; const assignNodes = findAllNodes(resourceIds, roleTreeData); - const params = { id, resourceIds: arrayToStringParams(assignNodes), diff --git a/admin-web/src/models/menu.js b/admin-web/src/models/menu.js index 6c25611c2..759930e74 100644 --- a/admin-web/src/models/menu.js +++ b/admin-web/src/models/menu.js @@ -200,9 +200,7 @@ export default { // const resultMenuData = data; if (data !== 'all') { const moveChildrenMenusData = moveChildrenMenus(antMenuData); - console.log('moveChildrenMenusData', moveChildrenMenusData); const buildTreeMenuData = buildTreeMenu(antMenuData, moveChildrenMenusData, data); - console.log('buildTreeMenuData', buildTreeMenuData); menuData = buildTreeMenuData; } diff --git a/admin-web/src/pages/Admin/RoleList.js b/admin-web/src/pages/Admin/RoleList.js index 2a35c29e9..a9dbd646e 100644 --- a/admin-web/src/pages/Admin/RoleList.js +++ b/admin-web/src/pages/Admin/RoleList.js @@ -3,19 +3,7 @@ import React, { PureComponent, Fragment } from 'react'; import { connect } from 'dva'; import moment from 'moment'; -import { - Card, - Form, - Input, - Select, - Spin, - Button, - Modal, - message, - Table, - Divider, - Tree, -} from 'antd'; +import { Card, Form, Input, Spin, Button, Modal, message, Table, Divider, Tree } from 'antd'; import PageHeaderWrapper from '@/components/PageHeaderWrapper'; import styles from './RoleList.less'; @@ -39,10 +27,6 @@ const CreateForm = Form.create()(props => { }); }; - const selectStyle = { - width: 200, - }; - const title = modalType === 'add' ? '添加一个 Role' : '更新一个 Role'; const okText = modalType === 'add' ? '添加' : '更新'; return ( diff --git a/admin-web/src/utils/tree.utils.js b/admin-web/src/utils/tree.utils.js index bb0653ff5..5733c1ad4 100644 --- a/admin-web/src/utils/tree.utils.js +++ b/admin-web/src/utils/tree.utils.js @@ -20,15 +20,13 @@ function findNodes(id, nodes) { if (node.key === id) { res.push(node.key); break; - } else { + } else if (node.children) { const childNodes = findNodes(id, node.children); - if (childNodes.length) { - res.push(node.key); - for (let j = 0; j < childNodes.length; j += 1) { - res.push(childNodes[j]); - } - break; + res.push(node.key); + for (let j = 0; j < childNodes.length; j += 1) { + res.push(childNodes[j]); } + break; } } return res;