mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
chore: clear some npm module that has not use
This commit is contained in:
parent
57f37ee68f
commit
35d279ff72
@ -3,11 +3,10 @@ import PropTypes from 'prop-types'
|
||||
import Mock from 'mockjs'
|
||||
import { Button, Input, Select, Card, Alert, Spin, Icon, Collapse, Radio, Tooltip, message } from 'antd'
|
||||
import { autobind } from 'core-decorators';
|
||||
import crossRequest from 'cross-request';
|
||||
import mockEditor from '../../containers/Project/Interface/InterfaceList/mockEditor'
|
||||
import URL from 'url';
|
||||
const MockExtra = require('common/mock-extra.js')
|
||||
import './Postman.scss'
|
||||
import './Postman.scss';
|
||||
|
||||
const { TextArea } = Input;
|
||||
const InputGroup = Input.Group;
|
||||
@ -38,7 +37,8 @@ export default class Run extends Component {
|
||||
bodyType: '',
|
||||
bodyOther: '',
|
||||
loading: false,
|
||||
validRes: null
|
||||
validRes: null,
|
||||
hasPlugin: true
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
@ -46,9 +46,30 @@ export default class Run extends Component {
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
let startTime = 0;
|
||||
this.interval = setInterval(()=>{
|
||||
startTime += 500;
|
||||
if(startTime > 5000){
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
if(window.crossRequest){
|
||||
clearInterval(this.interval);
|
||||
this.setState({
|
||||
hasPlugin: true
|
||||
})
|
||||
}else{
|
||||
this.setState({
|
||||
hasPlugin: false
|
||||
})
|
||||
}
|
||||
}, 500)
|
||||
this.getInterfaceState()
|
||||
}
|
||||
|
||||
componentWillUnmount(){
|
||||
clearInterval(this.interval)
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.data._id !== this.props.data._id) {
|
||||
this.getInterfaceState(nextProps)
|
||||
@ -139,7 +160,7 @@ export default class Run extends Component {
|
||||
|
||||
this.setState({ loading: true })
|
||||
|
||||
crossRequest({
|
||||
window.crossRequest({
|
||||
url: href,
|
||||
method,
|
||||
headers: this.getHeadersObj(headers),
|
||||
@ -359,10 +380,10 @@ export default class Run extends Component {
|
||||
})
|
||||
}
|
||||
|
||||
hasCrossRequestPlugin() {
|
||||
const dom = document.getElementById('y-request');
|
||||
return dom.getAttribute('key') === 'yapi';
|
||||
}
|
||||
// hasCrossRequestPlugin() {
|
||||
// const dom = document.getElementById('y-request');
|
||||
// return dom.getAttribute('key') === 'yapi';
|
||||
// }
|
||||
|
||||
objToArr(obj, key, value) {
|
||||
const keyName = key || 'name';
|
||||
@ -451,7 +472,7 @@ export default class Run extends Component {
|
||||
render () {
|
||||
|
||||
const { method, domains, pathParam, pathname, query, headers, bodyForm, caseEnv, bodyType, resHeader, loading, validRes } = this.state;
|
||||
const hasPlugin = this.hasCrossRequestPlugin();
|
||||
const hasPlugin = this.state.hasPlugin;
|
||||
const isResJson = resHeader && resHeader['content-type'] && resHeader['content-type'].indexOf('application/json') !== -1
|
||||
let path = pathname;
|
||||
pathParam.forEach(item => {
|
||||
|
20
npm-shrinkwrap.json
generated
20
npm-shrinkwrap.json
generated
@ -2726,11 +2726,6 @@
|
||||
"object-assign": "4.1.1"
|
||||
}
|
||||
},
|
||||
"cross-request": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/cross-request/-/cross-request-1.0.4.tgz",
|
||||
"integrity": "sha1-kgc6xR0EZv0yA1EjmJ0XNMC+Qr4="
|
||||
},
|
||||
"cross-spawn": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/cross-spawn/-/cross-spawn-3.0.1.tgz",
|
||||
@ -8727,11 +8722,6 @@
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
},
|
||||
"mock": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/mock/-/mock-0.1.1.tgz",
|
||||
"integrity": "sha1-5+NYnH5rM3bWn1o+RwtWYEQXxjM="
|
||||
},
|
||||
"mockjs": {
|
||||
"version": "1.0.1-beta3",
|
||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/mockjs/-/mockjs-1.0.1-beta3.tgz",
|
||||
@ -8745,11 +8735,6 @@
|
||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/moment/-/moment-2.18.1.tgz",
|
||||
"integrity": "sha1-w2GT3Tzhwu7SrbfIAtu8d6gbHA8="
|
||||
},
|
||||
"monaco-editor": {
|
||||
"version": "0.9.0",
|
||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/monaco-editor/-/monaco-editor-0.9.0.tgz",
|
||||
"integrity": "sha1-xQxTJRxHt/8S4J8Pg8/TKkTf5uw="
|
||||
},
|
||||
"mongodb": {
|
||||
"version": "2.2.27",
|
||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/mongodb/-/mongodb-2.2.27.tgz",
|
||||
@ -15295,11 +15280,6 @@
|
||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/yallist/-/yallist-2.1.2.tgz",
|
||||
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
|
||||
},
|
||||
"yapi-plugin-qsso": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "http://registry.npm.taobao.org/yapi-plugin-qsso/download/yapi-plugin-qsso-1.0.2.tgz",
|
||||
"integrity": "sha1-blrUEMXZAJg9DfYONIbrjYvtWxk="
|
||||
},
|
||||
"yargs": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/yargs/-/yargs-7.1.0.tgz",
|
||||
|
@ -37,7 +37,6 @@
|
||||
"clipboard": "^1.7.1",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"core-decorators": "^0.17.0",
|
||||
"cross-request": "^1.0.1",
|
||||
"css-loader": "^0.28.4",
|
||||
"eslint": "^3.19.0",
|
||||
"eslint-loader": "^1.9.0",
|
||||
@ -68,10 +67,8 @@
|
||||
"koa-websocket": "^4.0.0",
|
||||
"less": "^2.7.2",
|
||||
"less-loader": "^4.0.5",
|
||||
"mock": "^0.1.1",
|
||||
"mockjs": "^1.0.1-beta3",
|
||||
"moment": "^2.18.1",
|
||||
"monaco-editor": "^0.9.0",
|
||||
"mongoose": "4.10.8",
|
||||
"mongoose-auto-increment": "^5.0.1",
|
||||
"node-sass": "^4.5.3",
|
||||
@ -101,7 +98,6 @@
|
||||
"validate-commit-msg": "^2.12.2",
|
||||
"webpack": "^3.5.5",
|
||||
"webpack-dev-middleware": "^1.12.0",
|
||||
"yapi-plugin-qsso": "^1.0.2",
|
||||
"ykit-config-antd": "^0.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
Loading…
Reference in New Issue
Block a user