feat: 接口预览页面添加mock地址的链接

This commit is contained in:
wenbo.dong 2017-09-20 20:38:22 +08:00
parent 14a53edeb3
commit 39afe88561
2 changed files with 5 additions and 4 deletions

View File

@ -5,7 +5,6 @@ import PropTypes from 'prop-types'
import { Table,Icon } from 'antd'
const mockEditor = require('./mockEditor.js')
import { formatTime } from '../../../../common.js';
import { Link } from 'react-router-dom';
import ErrMsg from '../../../../components/ErrMsg/ErrMsg.js';
import variable from '../../../../constants/variable';
// import { Card } from 'antd'
@ -276,9 +275,7 @@ class View extends Component {
</div>
<div className="colMockUrl">
<span className="colKey">Mock地址</span>
<Link to={'https://baidu.com/'}>
<span className="colValue">{location.protocol + '//' + location.hostname + (location.port !== "" ? ":" + location.port : "") + `/mock/${this.props.currProject._id}${this.props.currProject.basepath}${this.props.curData.path}`}</span>
</Link>
<span className="colValue" onClick={() => window.open(location.protocol + '//' + location.hostname + (location.port !== "" ? ":" + location.port : "") + `/mock/${this.props.currProject._id}${this.props.currProject.basepath}${this.props.curData.path}`, '_blank')}>{location.protocol + '//' + location.hostname + (location.port !== "" ? ":" + location.port : "") + `/mock/${this.props.currProject._id}${this.props.currProject.basepath}${this.props.curData.path}`}</span>
</div>
{this.props.curData.desc?<div className="colDesc">
<span className="colKey">接口备注</span>

View File

@ -24,6 +24,10 @@
}
}
.colValue {
color: #2395f1;
cursor: pointer;
}
.ace_print-margin{
display: none;
}