diff --git a/client/ReduxContainer.js b/client/ReduxContainer.js index e79b22cb..96dd4744 100644 --- a/client/ReduxContainer.js +++ b/client/ReduxContainer.js @@ -1,4 +1,3 @@ -import LoginRedux from './reducer/Login/Login_redux.js' import login from './reducer/Login/login.js' import group from './reducer/group/group.js' import project from './reducer/group/project.js' @@ -10,7 +9,6 @@ import user from './reducer/user/user.js' export default { group, login, - LoginRedux, Interface, user, project, diff --git a/client/containers/Login/Login.js b/client/containers/Login/Login.js index 0ea8914c..21567aba 100644 --- a/client/containers/Login/Login.js +++ b/client/containers/Login/Login.js @@ -63,7 +63,7 @@ class Login extends Component { - + ) diff --git a/client/containers/ProjectGroups/ProjectList/ProjectList.js b/client/containers/ProjectGroups/ProjectList/ProjectList.js index 9170fe1a..26472a11 100644 --- a/client/containers/ProjectGroups/ProjectList/ProjectList.js +++ b/client/containers/ProjectGroups/ProjectList/ProjectList.js @@ -14,22 +14,28 @@ const Option = Select.Option; import './ProjectList.scss' -// 确认删除项目 -const deleteConfirm = (id, handleDelete, currGroupId, handleFetchList) => { - const test = () => { - handleDelete(id).then((res) => { +// 确认删除项目 handleDelete, currGroup._id, fetchProjectList +const deleteConfirm = (id, props) => { + const { delProject, currGroup, fetchProjectList } = props; + const handle = () => { + delProject(id).then((res) => { console.log(res); - console.log(handleFetchList, currGroupId); - handleFetchList(currGroupId).then((res) => { - console.log(res); - }); + console.log(fetchProjectList, currGroup._id); + if (res.payload.data.errcode == 0) { + message.success('删除成功!') + fetchProjectList(currGroup._id).then((res) => { + console.log(res); + }); + } else { + message.error(res.payload.data.errmsg); + } }); } - return test; + return handle; }; const getColumns = (data, props) => { - const { handleDelete, currGroup, fetchProjectList, changeUpdateModal, userInfo } = props; + const { changeUpdateModal, userInfo } = props; return [{ title: '项目名称', dataIndex: 'name', @@ -44,7 +50,7 @@ const getColumns = (data, props) => { render: (text, record, index) => { // data是projectList的列表值 // 根据序号找到对应项的uid,根据uid获取对应项目的创建人 - return {userInfo[data[index].uid].username}; + return {userInfo[data[index].uid] ? userInfo[data[index].uid].username : ''}; } }, { title: '创建时间', @@ -60,7 +66,7 @@ const getColumns = (data, props) => { changeUpdateModal(true, index)}>修改 - + 删除 diff --git a/client/containers/ProjectGroups/ProjectList/UpDateModal.js b/client/containers/ProjectGroups/ProjectList/UpDateModal.js index aa7da144..277e94b0 100644 --- a/client/containers/ProjectGroups/ProjectList/UpDateModal.js +++ b/client/containers/ProjectGroups/ProjectList/UpDateModal.js @@ -174,8 +174,9 @@ class UpDateModal extends Component { return item.host + ',' + item.name; }) } - initFormValues.prd_host = projectList[handleUpdateIndex].prd_host.split('\/\/')[1]; - initFormValues.prd_protocol = projectList[handleUpdateIndex].prd_host.split('\/\/')[0] + '\/\/'; + initFormValues.prd_host = projectList[handleUpdateIndex].prd_host; + initFormValues.prd_protocol = projectList[handleUpdateIndex].protocol + '\/\/'; + console.log(projectList); } getFieldDecorator('envs', { initialValue: envMessage }); diff --git a/client/reducer/Login/Login_redux.js b/client/reducer/Login/Login_redux.js deleted file mode 100644 index a2bd47e2..00000000 --- a/client/reducer/Login/Login_redux.js +++ /dev/null @@ -1,9 +0,0 @@ -export default function (state = 3, action) { - const count = state - switch (action.type) { - case 'increasec': - return count + 1 - default: - return state - } -} diff --git a/client/reducer/login/Login_redux.js b/client/reducer/login/Login_redux.js deleted file mode 100644 index a2bd47e2..00000000 --- a/client/reducer/login/Login_redux.js +++ /dev/null @@ -1,9 +0,0 @@ -export default function (state = 3, action) { - const count = state - switch (action.type) { - case 'increasec': - return count + 1 - default: - return state - } -}