mirror of
https://github.com/YMFE/yapi.git
synced 2025-04-18 15:20:25 +08:00
chore: 删除无用的代码
This commit is contained in:
parent
21d510a20a
commit
f9982b159d
@ -1,9 +1,9 @@
|
||||
import moment from 'moment';
|
||||
import constants from './constants/variable'
|
||||
import Mock from 'mockjs'
|
||||
import json5 from 'json5'
|
||||
import MockExtra from 'common/mock-extra.js'
|
||||
import {filter} from 'common/power-string.js'
|
||||
const moment = require('moment');
|
||||
const constants = require ('./constants/variable')
|
||||
const Mock = require('mockjs')
|
||||
const json5 = require('json5')
|
||||
const MockExtra = require('common/mock-extra.js')
|
||||
const filter = require('common/power-string.js').filter;
|
||||
|
||||
const Roles = {
|
||||
0 : 'admin',
|
||||
|
@ -229,16 +229,7 @@ class InterfaceColContent extends Component {
|
||||
}
|
||||
|
||||
let validRes = [];
|
||||
// 弃用 mock 字段验证功能
|
||||
// if (res && typeof res === 'object') {
|
||||
// if (interfaceData.mock_verify) {
|
||||
// let tpl = MockExtra(json_parse(interfaceData.res_body), {
|
||||
// query: interfaceData.req_query,
|
||||
// body: interfaceData.req_body_form
|
||||
// })
|
||||
// validRes = Mock.valid(tpl, res);
|
||||
// }
|
||||
// }
|
||||
|
||||
let responseData = Object.assign({}, {
|
||||
status: data.res.status,
|
||||
body: res,
|
||||
@ -319,32 +310,6 @@ class InterfaceColContent extends Component {
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
|
||||
getQueryObj = (query, requestParams) => {
|
||||
query = query || [];
|
||||
const queryObj = {};
|
||||
query.forEach(item => {
|
||||
if (item.name && item.enable) {
|
||||
queryObj[item.name] = this.handleValue(item.value);
|
||||
if (requestParams) {
|
||||
requestParams[item.name] = queryObj[item.name];
|
||||
}
|
||||
}
|
||||
})
|
||||
return queryObj;
|
||||
}
|
||||
getHeadersObj = (headers) => {
|
||||
headers = headers || [];
|
||||
const headersObj = {};
|
||||
headers.forEach(item => {
|
||||
if (item.name && item.value) {
|
||||
headersObj[item.name] = this.handleValue(item.value);
|
||||
}
|
||||
})
|
||||
return headersObj;
|
||||
}
|
||||
|
||||
onRow(row) {
|
||||
return {
|
||||
rowId: row.id,
|
||||
@ -555,7 +520,6 @@ class InterfaceColContent extends Component {
|
||||
return <Button onClick={() => this.openReport(rowData.id)}>测试报告</Button>
|
||||
}
|
||||
return <div className="interface-col-table-action">
|
||||
{/* <Button onClick={() => this.openAdv(rowData.id)} type="primary">高级</Button> */}
|
||||
{reportFun()}
|
||||
</div>
|
||||
}]
|
||||
|
Loading…
x
Reference in New Issue
Block a user