Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev

This commit is contained in:
wenbo.dong 2017-08-25 18:00:56 +08:00
commit 5e4c529093
3 changed files with 46 additions and 39 deletions

View File

@ -61,27 +61,27 @@ class InterfaceEdit extends Component {
}
componentWillMount() {
// let domain = location.hostname + (location.port !== "" ? ":" + location.port : "");
// let s = new WebSocket('ws://' + domain + '/api/interface/solve_conflict?id=' + this.props.match.params.actionId);
// s.onopen = () => {
// this.WebSocket = s;
// }
let domain = location.hostname + (location.port !== "" ? ":" + location.port : "");
let s = new WebSocket('ws://' + domain + '/api/interface/solve_conflict?id=' + this.props.match.params.actionId);
s.onopen = () => {
this.WebSocket = s;
}
// s.onmessage = (e) => {
// let result = JSON.parse(e.data);
// if (result.errno === 0) {
// this.setState({
// curdata: result.data,
// status: 1
// })
// } else {
// this.setState({
// curdata: result.data,
// status: 2
// })
// }
s.onmessage = (e) => {
let result = JSON.parse(e.data);
if (result.errno === 0) {
this.setState({
curdata: result.data,
status: 1
})
} else {
this.setState({
curdata: result.data,
status: 2
})
}
// }
}
}

View File

@ -552,9 +552,13 @@ class projectController extends baseController {
}
}
let data = {
up_time: yapi.commons.time()
};
if(params.project_type){
data.project_type = params.project_type
}
if (params.name) data.name = params.name;
if (params.desc) data.desc = params.desc;

View File

@ -148,7 +148,7 @@ var projectController = function (_baseController) {
}, {
key: 'add',
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;
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
@ -321,7 +321,7 @@ var projectController = function (_baseController) {
}, {
key: 'addMember',
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;
return _regenerator2.default.wrap(function _callee2$(_context2) {
while (1) {
@ -444,7 +444,7 @@ var projectController = function (_baseController) {
}, {
key: 'delMember',
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 params, check, result, username;
@ -542,7 +542,7 @@ var projectController = function (_baseController) {
}, {
key: 'getUserdata',
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;
return _regenerator2.default.wrap(function _callee4$(_context4) {
while (1) {
@ -600,7 +600,7 @@ var projectController = function (_baseController) {
}, {
key: 'getMemberList',
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;
return _regenerator2.default.wrap(function _callee5$(_context5) {
while (1) {
@ -662,7 +662,7 @@ var projectController = function (_baseController) {
}, {
key: 'get',
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;
return _regenerator2.default.wrap(function _callee6$(_context6) {
while (1) {
@ -747,7 +747,7 @@ var projectController = function (_baseController) {
}, {
key: 'list',
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 group_id, auth, result, follow, uids, _users, users;
return _regenerator2.default.wrap(function _callee7$(_context7) {
@ -847,7 +847,7 @@ var projectController = function (_baseController) {
}, {
key: 'del',
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;
return _regenerator2.default.wrap(function _callee8$(_context8) {
while (1) {
@ -940,7 +940,7 @@ var projectController = function (_baseController) {
}, {
key: 'changeMemberRole',
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 _this3 = this;
var params, projectInst, check, result, username;
@ -1056,7 +1056,7 @@ var projectController = function (_baseController) {
}, {
key: 'upSet',
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 _this4 = this;
var id, data, result;
@ -1146,7 +1146,7 @@ var projectController = function (_baseController) {
}, {
key: 'up',
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;
return _regenerator2.default.wrap(function _callee11$(_context11) {
while (1) {
@ -1230,6 +1230,9 @@ var projectController = function (_baseController) {
up_time: _yapi2.default.commons.time()
};
if (params.project_type) {
data.project_type = params.project_type;
}
if (params.name) data.name = params.name;
if (params.desc) data.desc = params.desc;
@ -1239,10 +1242,10 @@ var projectController = function (_baseController) {
if (params.env) data.env = params.env;
if (params.color) data.color = params.color;
if (params.icon) data.icon = params.icon;
_context11.next = 33;
_context11.next = 34;
return this.Model.up(id, data);
case 33:
case 34:
result = _context11.sent;
username = this.getUsername();
@ -1254,21 +1257,21 @@ var projectController = function (_baseController) {
typeid: id
});
ctx.body = _yapi2.default.commons.resReturn(result);
_context11.next = 42;
_context11.next = 43;
break;
case 39:
_context11.prev = 39;
case 40:
_context11.prev = 40;
_context11.t1 = _context11['catch'](0);
ctx.body = _yapi2.default.commons.resReturn(null, 402, _context11.t1.message);
case 42:
case 43:
case 'end':
return _context11.stop();
}
}
}, _callee11, this, [[0, 39]]);
}, _callee11, this, [[0, 40]]);
}));
function up(_x12) {
@ -1292,7 +1295,7 @@ var projectController = function (_baseController) {
}, {
key: 'search',
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;
return _regenerator2.default.wrap(function _callee12$(_context12) {
while (1) {
@ -1367,7 +1370,7 @@ var projectController = function (_baseController) {
}, {
key: 'download',
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;
return _regenerator2.default.wrap(function _callee13$(_context13) {
while (1) {