mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
aff3d17e77
@ -2,7 +2,7 @@ import React, { Component } from 'react'
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import InterfaceEditForm from './InterfaceEditForm.js'
|
import InterfaceEditForm from './InterfaceEditForm.js'
|
||||||
import { updateInterfaceData } from '../../../../reducer/modules/interface.js';
|
import { updateInterfaceData,fetchInterfaceList } from '../../../../reducer/modules/interface.js';
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { message } from 'antd'
|
import { message } from 'antd'
|
||||||
import './Edit.scss'
|
import './Edit.scss'
|
||||||
@ -15,7 +15,8 @@ import { withRouter, Link } from 'react-router-dom';
|
|||||||
currProject: state.project.currProject
|
currProject: state.project.currProject
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
updateInterfaceData
|
updateInterfaceData,
|
||||||
|
fetchInterfaceList
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -24,6 +25,7 @@ class InterfaceEdit extends Component {
|
|||||||
curdata: PropTypes.object,
|
curdata: PropTypes.object,
|
||||||
currProject: PropTypes.object,
|
currProject: PropTypes.object,
|
||||||
updateInterfaceData: PropTypes.func,
|
updateInterfaceData: PropTypes.func,
|
||||||
|
fetchInterfaceList: PropTypes.func,
|
||||||
match: PropTypes.object,
|
match: PropTypes.object,
|
||||||
switchToView: PropTypes.func
|
switchToView: PropTypes.func
|
||||||
}
|
}
|
||||||
@ -41,6 +43,7 @@ class InterfaceEdit extends Component {
|
|||||||
onSubmit = async (params) => {
|
onSubmit = async (params) => {
|
||||||
params.id = this.props.match.params.actionId;
|
params.id = this.props.match.params.actionId;
|
||||||
let result = await axios.post('/api/interface/up', params);
|
let result = await axios.post('/api/interface/up', params);
|
||||||
|
this.props.fetchInterfaceList(this.props.currProject._id).then();
|
||||||
if (result.data.errcode === 0) {
|
if (result.data.errcode === 0) {
|
||||||
this.props.updateInterfaceData(params);
|
this.props.updateInterfaceData(params);
|
||||||
message.success('保存成功');
|
message.success('保存成功');
|
||||||
|
@ -84,7 +84,7 @@ var interfaceColController = function (_baseController) {
|
|||||||
(0, _createClass3.default)(interfaceColController, [{
|
(0, _createClass3.default)(interfaceColController, [{
|
||||||
key: 'list',
|
key: 'list',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
|
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
|
||||||
var id, result, i;
|
var id, result, i;
|
||||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -159,7 +159,7 @@ var interfaceColController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'addCol',
|
key: 'addCol',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(ctx) {
|
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(ctx) {
|
||||||
var params, auth, result, username;
|
var params, auth, result, username;
|
||||||
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -265,7 +265,7 @@ var interfaceColController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'getCaseList',
|
key: 'getCaseList',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(ctx) {
|
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(ctx) {
|
||||||
var id, inst, result, index, interfaceData, projectData;
|
var id, inst, result, index, interfaceData, projectData;
|
||||||
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -357,7 +357,7 @@ var interfaceColController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'addCase',
|
key: 'addCase',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(ctx) {
|
var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(ctx) {
|
||||||
var _this2 = this;
|
var _this2 = this;
|
||||||
|
|
||||||
var params, auth, result, username;
|
var params, auth, result, username;
|
||||||
@ -494,7 +494,7 @@ var interfaceColController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'upCase',
|
key: 'upCase',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(ctx) {
|
var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(ctx) {
|
||||||
var _this3 = this;
|
var _this3 = this;
|
||||||
|
|
||||||
var params, caseData, auth, result, username;
|
var params, caseData, auth, result, username;
|
||||||
@ -609,7 +609,7 @@ var interfaceColController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'getCase',
|
key: 'getCase',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(ctx) {
|
var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(ctx) {
|
||||||
var id, result, data, projectData;
|
var id, result, data, projectData;
|
||||||
return _regenerator2.default.wrap(function _callee6$(_context6) {
|
return _regenerator2.default.wrap(function _callee6$(_context6) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -707,7 +707,7 @@ var interfaceColController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'upCol',
|
key: 'upCol',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(ctx) {
|
var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(ctx) {
|
||||||
var params, id, colData, auth, result, username;
|
var params, id, colData, auth, result, username;
|
||||||
return _regenerator2.default.wrap(function _callee7$(_context7) {
|
return _regenerator2.default.wrap(function _callee7$(_context7) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -792,7 +792,7 @@ var interfaceColController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'upCaseIndex',
|
key: 'upCaseIndex',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(ctx) {
|
var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(ctx) {
|
||||||
var _this4 = this;
|
var _this4 = this;
|
||||||
|
|
||||||
var params;
|
var params;
|
||||||
@ -861,7 +861,7 @@ var interfaceColController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'delCol',
|
key: 'delCol',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(ctx) {
|
var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(ctx) {
|
||||||
var id, colData, auth, result, username;
|
var id, colData, auth, result, username;
|
||||||
return _regenerator2.default.wrap(function _callee9$(_context9) {
|
return _regenerator2.default.wrap(function _callee9$(_context9) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -947,7 +947,7 @@ var interfaceColController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'delCase',
|
key: 'delCase',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(ctx) {
|
var _ref10 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(ctx) {
|
||||||
var _this5 = this;
|
var _this5 = this;
|
||||||
|
|
||||||
var caseid, caseData, auth, result, username;
|
var caseid, caseData, auth, result, username;
|
||||||
|
@ -148,7 +148,7 @@ var projectController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'add',
|
key: 'add',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
|
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
|
||||||
var params, checkRepeat, data, result, colInst, catInst, username;
|
var params, checkRepeat, data, result, colInst, catInst, username;
|
||||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -320,7 +320,7 @@ var projectController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'addMember',
|
key: 'addMember',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(ctx) {
|
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(ctx) {
|
||||||
var params, check, userdata, result, username;
|
var params, check, userdata, result, username;
|
||||||
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -443,7 +443,7 @@ var projectController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'delMember',
|
key: 'delMember',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(ctx) {
|
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(ctx) {
|
||||||
var _this2 = this;
|
var _this2 = this;
|
||||||
|
|
||||||
var params, check, result, username;
|
var params, check, result, username;
|
||||||
@ -541,7 +541,7 @@ var projectController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'getUserdata',
|
key: 'getUserdata',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(uid, role) {
|
var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(uid, role) {
|
||||||
var userInst, userData;
|
var userInst, userData;
|
||||||
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -599,7 +599,7 @@ var projectController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'getMemberList',
|
key: 'getMemberList',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(ctx) {
|
var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(ctx) {
|
||||||
var params, project;
|
var params, project;
|
||||||
return _regenerator2.default.wrap(function _callee5$(_context5) {
|
return _regenerator2.default.wrap(function _callee5$(_context5) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -661,7 +661,7 @@ var projectController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'get',
|
key: 'get',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(ctx) {
|
var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(ctx) {
|
||||||
var params, result, catInst, cat;
|
var params, result, catInst, cat;
|
||||||
return _regenerator2.default.wrap(function _callee6$(_context6) {
|
return _regenerator2.default.wrap(function _callee6$(_context6) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -746,7 +746,7 @@ var projectController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'list',
|
key: 'list',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(ctx) {
|
var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(ctx) {
|
||||||
var _this3 = this;
|
var _this3 = this;
|
||||||
|
|
||||||
var group_id, project_list, auth, result, follow, _loop, index, item, r, _ret;
|
var group_id, project_list, auth, result, follow, _loop, index, item, r, _ret;
|
||||||
@ -781,7 +781,7 @@ var projectController = function (_baseController) {
|
|||||||
|
|
||||||
case 12:
|
case 12:
|
||||||
follow = _context8.sent;
|
follow = _context8.sent;
|
||||||
_loop = /*#__PURE__*/_regenerator2.default.mark(function _loop(index, _item, _r) {
|
_loop = _regenerator2.default.mark(function _loop(index, _item, _r) {
|
||||||
var f;
|
var f;
|
||||||
return _regenerator2.default.wrap(function _loop$(_context7) {
|
return _regenerator2.default.wrap(function _loop$(_context7) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -898,7 +898,7 @@ var projectController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'del',
|
key: 'del',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(ctx) {
|
var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(ctx) {
|
||||||
var id, interfaceInst, interfaceColInst, interfaceCaseInst, result;
|
var id, interfaceInst, interfaceColInst, interfaceCaseInst, result;
|
||||||
return _regenerator2.default.wrap(function _callee8$(_context9) {
|
return _regenerator2.default.wrap(function _callee8$(_context9) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -991,7 +991,7 @@ var projectController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'changeMemberRole',
|
key: 'changeMemberRole',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(ctx) {
|
var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(ctx) {
|
||||||
var _this4 = this;
|
var _this4 = this;
|
||||||
|
|
||||||
var params, projectInst, check, result, username;
|
var params, projectInst, check, result, username;
|
||||||
@ -1107,7 +1107,7 @@ var projectController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'upSet',
|
key: 'upSet',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(ctx) {
|
var _ref10 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(ctx) {
|
||||||
var _this5 = this;
|
var _this5 = this;
|
||||||
|
|
||||||
var id, data, result;
|
var id, data, result;
|
||||||
@ -1197,7 +1197,7 @@ var projectController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'up',
|
key: 'up',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(ctx) {
|
var _ref11 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee11(ctx) {
|
||||||
var id, params, projectData, checkRepeat, data, result, username;
|
var id, params, projectData, checkRepeat, data, result, username;
|
||||||
return _regenerator2.default.wrap(function _callee11$(_context12) {
|
return _regenerator2.default.wrap(function _callee11$(_context12) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -1346,7 +1346,7 @@ var projectController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'search',
|
key: 'search',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(ctx) {
|
var _ref12 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee12(ctx) {
|
||||||
var q, projectList, groupList, projectRules, groupRules, queryList;
|
var q, projectList, groupList, projectRules, groupRules, queryList;
|
||||||
return _regenerator2.default.wrap(function _callee12$(_context13) {
|
return _regenerator2.default.wrap(function _callee12$(_context13) {
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -1421,7 +1421,7 @@ var projectController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'download',
|
key: 'download',
|
||||||
value: function () {
|
value: function () {
|
||||||
var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(ctx) {
|
var _ref13 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee13(ctx) {
|
||||||
var project_id, interfaceInst, count, arr, fileName, res;
|
var project_id, interfaceInst, count, arr, fileName, res;
|
||||||
return _regenerator2.default.wrap(function _callee13$(_context14) {
|
return _regenerator2.default.wrap(function _callee13$(_context14) {
|
||||||
while (1) {
|
while (1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user