mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-15 05:10:47 +08:00
fix: interfaceContent bug
This commit is contained in:
parent
2c9a57b357
commit
9bec5d6bb4
@ -71,7 +71,7 @@ class Interface extends Component {
|
||||
<div className="right-content">
|
||||
<Switch>
|
||||
<Route exact path="/project/:id/interface/:action" component={InterfaceRoute} />
|
||||
<Route path="/project/:id/interface/:action/:actionId" component={InterfaceRoute} />
|
||||
<Route exact path="/project/:id/interface/:action/:actionId" component={InterfaceRoute} />
|
||||
</Switch>
|
||||
</div>
|
||||
</Col>
|
||||
|
@ -48,15 +48,13 @@ class Content extends Component {
|
||||
|
||||
handleRequest(nextProps) {
|
||||
let matchParams = nextProps.match.params;
|
||||
let _actionId;
|
||||
_actionId = matchParams.actionId || 0;
|
||||
if (_actionId === 0 && (nextProps.list.length > 0)) {
|
||||
|
||||
if (!matchParams.actionId && (nextProps.list.length > 0)) {
|
||||
return this.props.history.replace('/project/' + matchParams.id + '/interface/api/' + nextProps.list[0]._id)
|
||||
}
|
||||
if (!nextProps.curdata) return;
|
||||
if (this._actionId !== _actionId) {
|
||||
this._actionId = _actionId;
|
||||
this.props.fetchInterfaceData(_actionId)
|
||||
if (matchParams.actionId && this._actionId !== matchParams.actionId) {
|
||||
this._actionId = matchParams.actionId;
|
||||
this.props.fetchInterfaceData(matchParams.actionId)
|
||||
}
|
||||
this.setState({
|
||||
curtab: 'view'
|
||||
|
@ -193,6 +193,7 @@ class View extends Component {
|
||||
render () {
|
||||
|
||||
const dataSource = [];
|
||||
console.log(this.props.curData)
|
||||
if(this.props.curData.req_headers&&this.props.curData.req_headers.length){
|
||||
this.props.curData.req_headers.map((item,i)=>{
|
||||
dataSource.push({
|
||||
|
Loading…
Reference in New Issue
Block a user