diff --git a/client/components/Header/Header.js b/client/components/Header/Header.js index 982d6b68..4a4d96ff 100644 --- a/client/components/Header/Header.js +++ b/client/components/Header/Header.js @@ -142,8 +142,8 @@ class HeaderCom extends Component { 首页 - - 分组 + + 分组 接口 diff --git a/client/containers/AddInterface/AddInterface.js b/client/containers/AddInterface/AddInterface.js index 5dfdb26e..38ad4144 100644 --- a/client/containers/AddInterface/AddInterface.js +++ b/client/containers/AddInterface/AddInterface.js @@ -73,6 +73,7 @@ class AddInterface extends Component { let interfaceId = undefined if (ifTrue) { interfaceId = this.getInterfaceId() + console.log('interfaceId', interfaceId) this.initInterfaceData(interfaceId) } else { const props = this.props @@ -91,8 +92,10 @@ class AddInterface extends Component { } getInterfaceId () { - const value = location.hash.match(/\d+/g) - return value ? value[0] : '' + const reg = /AddInterface\/edit\/(\d+)/g + const url = location.href + url.match(reg) + return RegExp.$1 } verificationURL () { @@ -159,7 +162,7 @@ class AddInterface extends Component { path: url, method: 'POST', req_headers: seqGroup, - project_id: 558, + project_id: interfaceId, req_params_type: 'json', req_params_other: reqParams, res_body_type: 'json', @@ -180,7 +183,6 @@ class AddInterface extends Component { this.setLoading() success() this.changeState(true) - // this.routerPage() }) .catch(e => { console.log(e) diff --git a/client/containers/AddInterface/ResParams/ResParams.js b/client/containers/AddInterface/ResParams/ResParams.js index 475aed33..32681c0d 100644 --- a/client/containers/AddInterface/ResParams/ResParams.js +++ b/client/containers/AddInterface/ResParams/ResParams.js @@ -38,10 +38,8 @@ class ResParams extends Component { const reg = /(

)|(<\/p>)| |(
)|\s+|

|<\/div>/g editor.customConfig.menus = [] editor.customConfig.onchange = html => { - console.log(html) - html = html.match(/{.*}/g)[0] + // html = html.match(/{.*}/g)[0] html = html.replace(reg, '') - console.log(html) this.props.getResParams(html) } setTimeout(() => { diff --git a/client/containers/Interface/Interface.js b/client/containers/Interface/Interface.js index 88852848..0a96066a 100644 --- a/client/containers/Interface/Interface.js +++ b/client/containers/Interface/Interface.js @@ -42,10 +42,10 @@ class Interface extends Component { } componentWillMount () { - // 558 665 704 743 + const interfaceId = this.getInterfaceId() const params = { params: { - project_id: 558 + project_id: interfaceId } } @@ -63,6 +63,13 @@ class Interface extends Component { }) } + getInterfaceId () { + const reg = /Interface\/(\d+)/g + const url = location.href + url.match(reg) + return RegExp.$1 + } + render () { const { interfaceData, projectMember, modalVisible } = this.props return ( diff --git a/client/containers/Interface/Interface.scss b/client/containers/Interface/Interface.scss index 308e672f..07489b8f 100644 --- a/client/containers/Interface/Interface.scss +++ b/client/containers/Interface/Interface.scss @@ -32,7 +32,7 @@ .interface-table { -webkit-box-flex: 1; - margin: 0 0 0 20px; + margin: 0 20px; .ant-table-wrapper table { font-size: .14rem; diff --git a/client/containers/Interface/InterfaceList/InterfaceList.js b/client/containers/Interface/InterfaceList/InterfaceList.js index e7cfe677..b0720f50 100644 --- a/client/containers/Interface/InterfaceList/InterfaceList.js +++ b/client/containers/Interface/InterfaceList/InterfaceList.js @@ -11,16 +11,24 @@ class InterfaceList extends Component { super(props) } + getInterfaceId () { + const reg = /Interface\/(\d+)/g + const url = location.href + url.match(reg) + return RegExp.$1 + } + render () { const { projectMember } = this.props - + const getInterfaceId = this.getInterfaceId() + console.log(`/AddInterface/${getInterfaceId}`) return (
    -
  • 添加接口
  • +
  • 添加接口
  • 管理项目成员
) } } -export default InterfaceList \ No newline at end of file +export default InterfaceList diff --git a/client/containers/ProjectGroups/ProjectList/ProjectList.js b/client/containers/ProjectGroups/ProjectList/ProjectList.js index 6c2130c8..ee6138eb 100644 --- a/client/containers/ProjectGroups/ProjectList/ProjectList.js +++ b/client/containers/ProjectGroups/ProjectList/ProjectList.js @@ -41,7 +41,7 @@ const getColumns = (data, props) => { dataIndex: 'name', key: 'name', render: (text, record) => { - return {text} + return {text} } }, { title: '创建人',