Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev

This commit is contained in:
sean 2017-07-26 17:56:54 +08:00
commit 784ba316af
8 changed files with 18 additions and 11 deletions

View File

@ -2,7 +2,6 @@ import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types'
import { changeMenuItem } from '../actions/menu'
import { message } from 'antd'
export function requireAuthentication(Component) {
@ -27,7 +26,6 @@ export function requireAuthentication(Component) {
if( !this.props.isAuthenticated ){
this.props.history.push('/');
this.props.changeMenuItem('/');
message.info('请先登录',1);
}
}
render() {

View File

@ -88,6 +88,9 @@ class HeaderCom extends Component {
}
linkTo = (e) =>{
this.props.changeMenuItem(e.key);
if(!this.props.login){
message.info('请先登录',1);
}
}
relieveLink = () => {
this.props.changeMenuItem("");

View File

@ -239,7 +239,7 @@ class AddInterface extends Component {
render () {
const TabPane = Tabs.TabPane
const { isLoading, isSave, mockJson='', mockURL } = this.state
console.log(mockURL)
return (
<section className="add-interface-box">
<div className="content">

View File

@ -86,8 +86,8 @@ export default class InterfaceTest extends Component {
a:1
},
success: (res, header) => {
this.setState({res})
console.log(header)
this.setState({res})
}
})
}

View File

@ -11,7 +11,6 @@ import {
// 重新渲染页面
const getReqList = function (self) {
const [reqList, seqGroup] = [[], self.props.seqGroup]
console.log('seqGroup', seqGroup)
seqGroup.map((value, key) => {
reqList.push(<ReqList key={key} value={value} dataNum={value.id} />)
})

View File

@ -40,7 +40,6 @@ class ReqMethod extends Component {
@autobind
handleChange (value) {
console.log('value', value)
this.props.pushInterfaceMethod(value)
}

View File

@ -1,7 +1,8 @@
import React, { Component } from 'react'
import { Table } from 'antd'
import { Table, Popconfirm, message } from 'antd'
import PropTypes from 'prop-types'
import axios from 'axios'
import { autobind } from 'core-decorators'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import { deleteInterfaceData } from '../../../actions/interfaceAction.js'
@ -29,6 +30,12 @@ class InterfaceTable extends Component {
super(props)
}
@autobind
confirm (interfaceId) {
this.deleteInterface(interfaceId)
message.success('删除成功!');
}
deleteInterfaceData (interfaceId) {
let interfaceArr = []
let { interfaceData } = this.props
@ -70,15 +77,17 @@ class InterfaceTable extends Component {
title: '功能',
'key': 'action',
render: (data) => {
const deleteInterface = this.deleteInterface.bind(this, data._id)
console.log(data)
// const deleteInterface = this.deleteInterface.bind(this, data._id)
const confirm = this.confirm.bind(this, data._id)
return (
<span>
<Link to={`/AddInterface/edit/${data._id}`}><span>编辑</span></Link>
<span className="ant-divider" />
<Link to={`/AddInterface/edit/${data._id}`}><span>测试</span></Link>
<span className="ant-divider" />
<a onClick={deleteInterface}>删除</a>
<Popconfirm title="是否删除接口!" onConfirm={confirm} okText="Yes" cancelText="No">
<a href="">删除</a>
</Popconfirm>
</span>
)
}

View File

@ -4,7 +4,6 @@
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20);
border-radius: 4px;
text-align: right;
min-height: 700px;;
}
.m-table {