fix: modify

This commit is contained in:
qitmac000249 2017-08-24 16:40:33 +08:00
parent 102a2c799e
commit 6268c37ef2
13 changed files with 195 additions and 124 deletions

View File

@ -76,7 +76,15 @@ class interfaceColController extends baseController{
uid: this.getUid(),
add_time: yapi.commons.time(),
up_time: yapi.commons.time()
})
});
let username = this.getUsername();
yapi.commons.saveLog({
content: `用户 "${username}" 添加了接口集 "${params.name}"`,
type: 'project',
uid: this.getUid(),
username: username,
typeid: params.project_id
});
ctx.body = yapi.commons.resReturn(result);
}catch(e){
@ -163,6 +171,15 @@ class interfaceColController extends baseController{
params.up_time = yapi.commons.time();
let result = await this.caseModel.save(params);
let col = await this.colModel.get(params.project_id);
let username = this.getUsername();
yapi.commons.saveLog({
content: `用户 "${username}" 在接口集 "${col.name}" 下添加了接口用例 "${params.casename}"`,
type: 'project',
uid: this.getUid(),
username: username,
typeid: params.project_id
});
ctx.body = yapi.commons.resReturn(result);
}catch(e){
@ -171,7 +188,7 @@ class interfaceColController extends baseController{
}
/**
* 增加一个接口用例
* 更新一个接口用例
* @interface /col/up_case
* @method POST
* @category col
@ -208,7 +225,7 @@ class interfaceColController extends baseController{
return ctx.body = yapi.commons.resReturn(null, 400, '用例名称不能为空');
}
let caseData = await this.caseModel.get(id);
let caseData = await this.caseModel.get(params.id);
let auth = await this.checkAuth(caseData.project_id, 'project', 'edit')
if (!auth) {
return ctx.body = yapi.commons.resReturn(null, 400, '没有权限');
@ -218,6 +235,16 @@ class interfaceColController extends baseController{
let result = await this.caseModel.up(params.id, params);
let col = await this.colModel.get(caseData.col_id);
let username = this.getUsername();
yapi.commons.saveLog({
content: `用户 "${username}" 在接口集 "${col.name}" 更新了接口用例 "${params.casename}"`,
type: 'project',
uid: this.getUid(),
username: username,
typeid: caseData.project_id
});
ctx.body = yapi.commons.resReturn(result);
}catch(e){
@ -272,7 +299,15 @@ class interfaceColController extends baseController{
name: params.name,
desc: params.desc,
up_time: yapi.commons.time()
})
});
let username = this.getUsername();
yapi.commons.saveLog({
content: `用户 "${username}" 更新了接口集 "${params.name}" 的信息`,
type: 'project',
uid: this.getUid(),
username: username,
typeid: colData.project_id
});
ctx.body = yapi.commons.resReturn(result)
}catch(e){
ctx.body = yapi.commons.resReturn(null, 400, e.message)

View File

@ -72,7 +72,7 @@ app.use(compress({
}));
app.use(function () {
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx, next) {
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx, next) {
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {

View File

@ -59,7 +59,7 @@ var baseController = function () {
(0, _createClass3.default)(baseController, [{
key: 'init',
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 ignoreRouter;
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
@ -103,7 +103,7 @@ var baseController = function () {
}, {
key: 'checkLogin',
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 token, uid, userInst, result, decoded;
return _regenerator2.default.wrap(function _callee2$(_context2) {
while (1) {
@ -170,7 +170,7 @@ var baseController = function () {
}, {
key: 'getLoginStatus',
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 result;
return _regenerator2.default.wrap(function _callee3$(_context3) {
while (1) {
@ -222,7 +222,7 @@ var baseController = function () {
}, {
key: 'getProjectRole',
value: function () {
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(id, type) {
var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(id, type) {
var _this = this;
var result, interfaceInst, interfaceData, projectInst, projectData, memberData, groupInst, groupData, groupMemberData;
@ -379,7 +379,7 @@ var baseController = function () {
}, {
key: 'checkAuth',
value: function () {
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(id, type, action) {
var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(id, type, action) {
var role;
return _regenerator2.default.wrap(function _callee5$(_context5) {
while (1) {

View File

@ -74,7 +74,7 @@ var followController = function (_baseController) {
(0, _createClass3.default)(followController, [{
key: 'list',
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 uid, page, limit, result;
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
@ -139,7 +139,7 @@ var followController = function (_baseController) {
}, {
key: 'del',
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, uid, checkRepeat, result;
return _regenerator2.default.wrap(function _callee2$(_context2) {
while (1) {
@ -217,7 +217,7 @@ var followController = function (_baseController) {
}, {
key: 'add',
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 params, uid, checkRepeat, project, data, result;
return _regenerator2.default.wrap(function _callee3$(_context3) {
while (1) {

View File

@ -88,7 +88,7 @@ var groupController = function (_baseController) {
(0, _createClass3.default)(groupController, [{
key: 'get',
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, groupInst, result;
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
@ -160,7 +160,7 @@ var groupController = function (_baseController) {
}, {
key: 'add',
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, groupUserdata, groupInst, checkRepeat, data, result;
return _regenerator2.default.wrap(function _callee2$(_context2) {
while (1) {
@ -272,7 +272,7 @@ var groupController = function (_baseController) {
}, {
key: 'getUserdata',
value: function () {
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(uid, role) {
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(uid, role) {
var userInst, userData;
return _regenerator2.default.wrap(function _callee3$(_context3) {
while (1) {
@ -333,7 +333,7 @@ var groupController = function (_baseController) {
}, {
key: 'addMember',
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 params, groupInst, check, groupUserdata, result;
return _regenerator2.default.wrap(function _callee4$(_context4) {
while (1) {
@ -446,7 +446,7 @@ var groupController = function (_baseController) {
}, {
key: 'changeMemberRole',
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, groupInst, check, result;
return _regenerator2.default.wrap(function _callee5$(_context5) {
while (1) {
@ -547,7 +547,7 @@ var groupController = function (_baseController) {
}, {
key: 'getMemberList',
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, groupInst, group;
return _regenerator2.default.wrap(function _callee6$(_context6) {
while (1) {
@ -611,7 +611,7 @@ var groupController = function (_baseController) {
}, {
key: 'delMember',
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, groupInst, check, result;
return _regenerator2.default.wrap(function _callee7$(_context7) {
while (1) {
@ -709,7 +709,7 @@ var groupController = function (_baseController) {
}, {
key: 'list',
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 groupInst, result;
return _regenerator2.default.wrap(function _callee8$(_context8) {
while (1) {
@ -762,7 +762,7 @@ var groupController = function (_baseController) {
}, {
key: 'del',
value: function () {
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(ctx) {
var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(ctx) {
var _this2 = this;
var groupInst, projectInst, interfaceInst, interfaceColInst, interfaceCaseInst, _id, projectList, result;
@ -802,7 +802,7 @@ var groupController = function (_baseController) {
projectList = _context10.sent;
projectList.forEach(function () {
var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(p) {
var _ref10 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(p) {
return _regenerator2.default.wrap(function _callee9$(_context9) {
while (1) {
switch (_context9.prev = _context9.next) {
@ -881,7 +881,7 @@ var groupController = 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 groupInst, _id2, data, result;
return _regenerator2.default.wrap(function _callee11$(_context11) {

View File

@ -105,7 +105,7 @@ var interfaceController = function (_baseController) {
(0, _createClass3.default)(interfaceController, [{
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, auth, checkRepeat, data, result, username, cate;
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
@ -273,7 +273,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'get',
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, result;
return _regenerator2.default.wrap(function _callee2$(_context2) {
while (1) {
@ -335,7 +335,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'list',
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 project_id, result;
return _regenerator2.default.wrap(function _callee3$(_context3) {
while (1) {
@ -385,7 +385,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'listByCat',
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 catid, result;
return _regenerator2.default.wrap(function _callee4$(_context4) {
while (1) {
@ -435,7 +435,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'listByMenu',
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 project_id, result, newResult, i, item, list, j;
return _regenerator2.default.wrap(function _callee5$(_context5) {
while (1) {
@ -540,7 +540,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'up',
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, id, interfaceData, auth, checkRepeat, data, result, username, cate, inter;
return _regenerator2.default.wrap(function _callee6$(_context6) {
while (1) {
@ -753,7 +753,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'del',
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 id, data, auth, inter, result, username, cate;
return _regenerator2.default.wrap(function _callee7$(_context7) {
while (1) {
@ -847,7 +847,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'solveConflict',
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 _this2 = this;
var id, result, userInst, userinfo, data;
@ -930,7 +930,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'addCat',
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 params, auth, result, username;
return _regenerator2.default.wrap(function _callee9$(_context9) {
while (1) {
@ -1025,7 +1025,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'upCat',
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 params, result, username, cate, auth;
return _regenerator2.default.wrap(function _callee10$(_context10) {
while (1) {
@ -1097,7 +1097,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'delCat',
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, catData, auth, cate, result, r, username;
return _regenerator2.default.wrap(function _callee11$(_context11) {
while (1) {

View File

@ -74,17 +74,16 @@ var interfaceColController = function (_baseController) {
(0, _createClass3.default)(interfaceColController, [{
key: 'list',
value: function () {
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
var _id, result, i;
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
var id, result, i;
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
_id = ctx.query.project_id;
id = ctx.query.project_id;
_context.next = 4;
return this.colModel.list(_id);
return this.colModel.list(id);
case 4:
result = _context.sent;
@ -150,8 +149,8 @@ var interfaceColController = function (_baseController) {
}, {
key: 'addCol',
value: function () {
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(ctx) {
var params, auth, result;
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(ctx) {
var params, auth, result, username;
return _regenerator2.default.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
@ -207,24 +206,32 @@ var interfaceColController = function (_baseController) {
case 14:
result = _context2.sent;
username = this.getUsername();
_yapi2.default.commons.saveLog({
content: '\u7528\u6237 "' + username + '" \u6DFB\u52A0\u4E86\u63A5\u53E3\u96C6 "' + params.name + '"',
type: 'project',
uid: this.getUid(),
username: username,
typeid: params.project_id
});
ctx.body = _yapi2.default.commons.resReturn(result);
_context2.next = 21;
_context2.next = 23;
break;
case 18:
_context2.prev = 18;
case 20:
_context2.prev = 20;
_context2.t0 = _context2['catch'](0);
ctx.body = _yapi2.default.commons.resReturn(null, 402, _context2.t0.message);
case 21:
case 23:
case 'end':
return _context2.stop();
}
}
}, _callee2, this, [[0, 18]]);
}, _callee2, this, [[0, 20]]);
}));
function addCol(_x2) {
@ -248,18 +255,17 @@ var interfaceColController = function (_baseController) {
}, {
key: 'getCaseList',
value: function () {
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(ctx) {
var _id2, inst, result;
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(ctx) {
var id, inst, result;
return _regenerator2.default.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
_context3.prev = 0;
_id2 = ctx.query.col_id;
id = ctx.query.col_id;
inst = _yapi2.default.getInst(_interfaceCase2.default);
_context3.next = 5;
return inst.list(_id2, 'all');
return inst.list(id, 'all');
case 5:
result = _context3.sent;
@ -313,8 +319,8 @@ var interfaceColController = function (_baseController) {
}, {
key: 'addCase',
value: function () {
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(ctx) {
var params, auth, result;
var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(ctx) {
var params, auth, result, col, username;
return _regenerator2.default.wrap(function _callee4$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
@ -378,25 +384,37 @@ var interfaceColController = function (_baseController) {
case 20:
result = _context4.sent;
_context4.next = 23;
return this.colModel.get(params.project_id);
case 23:
col = _context4.sent;
username = this.getUsername();
_yapi2.default.commons.saveLog({
content: '\u7528\u6237 "' + username + '" \u5728\u63A5\u53E3\u96C6 "' + col.name + '" \u4E0B\u6DFB\u52A0\u4E86\u63A5\u53E3\u7528\u4F8B "' + params.casename + '"',
type: 'project',
uid: this.getUid(),
username: username,
typeid: params.project_id
});
ctx.body = _yapi2.default.commons.resReturn(result);
_context4.next = 27;
_context4.next = 32;
break;
case 24:
_context4.prev = 24;
case 29:
_context4.prev = 29;
_context4.t0 = _context4['catch'](0);
ctx.body = _yapi2.default.commons.resReturn(null, 402, _context4.t0.message);
case 27:
case 32:
case 'end':
return _context4.stop();
}
}
}, _callee4, this, [[0, 24]]);
}, _callee4, this, [[0, 29]]);
}));
function addCase(_x4) {
@ -407,7 +425,7 @@ var interfaceColController = function (_baseController) {
}()
/**
* 增加一个接口用例
* 更新一个接口用例
* @interface /col/up_case
* @method POST
* @category col
@ -429,8 +447,8 @@ var interfaceColController = function (_baseController) {
}, {
key: 'upCase',
value: function () {
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(ctx) {
var params, caseData, auth, result;
var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(ctx) {
var params, caseData, auth, result, col, username;
return _regenerator2.default.wrap(function _callee5$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
@ -462,7 +480,7 @@ var interfaceColController = function (_baseController) {
case 7:
_context5.next = 9;
return this.caseModel.get(id);
return this.caseModel.get(params.id);
case 9:
caseData = _context5.sent;
@ -488,25 +506,38 @@ var interfaceColController = function (_baseController) {
case 18:
result = _context5.sent;
_context5.next = 21;
return this.colModel.get(caseData.col_id);
case 21:
col = _context5.sent;
username = this.getUsername();
_yapi2.default.commons.saveLog({
content: '\u7528\u6237 "' + username + '" \u5728\u63A5\u53E3\u96C6 "' + col.name + '" \u66F4\u65B0\u4E86\u63A5\u53E3\u7528\u4F8B "' + params.casename + '"',
type: 'project',
uid: this.getUid(),
username: username,
typeid: caseData.project_id
});
ctx.body = _yapi2.default.commons.resReturn(result);
_context5.next = 25;
_context5.next = 30;
break;
case 22:
_context5.prev = 22;
case 27:
_context5.prev = 27;
_context5.t0 = _context5['catch'](0);
ctx.body = _yapi2.default.commons.resReturn(null, 402, _context5.t0.message);
case 25:
case 30:
case 'end':
return _context5.stop();
}
}
}, _callee5, this, [[0, 22]]);
}, _callee5, this, [[0, 27]]);
}));
function upCase(_x5) {
@ -530,17 +561,16 @@ var interfaceColController = function (_baseController) {
}, {
key: 'getCase',
value: function () {
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(ctx) {
var _id3, result;
var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(ctx) {
var id, result;
return _regenerator2.default.wrap(function _callee6$(_context6) {
while (1) {
switch (_context6.prev = _context6.next) {
case 0:
_context6.prev = 0;
_id3 = ctx.query.caseid;
id = ctx.query.caseid;
_context6.next = 4;
return this.caseModel.get(_id3);
return this.caseModel.get(id);
case 4:
result = _context6.sent;
@ -585,18 +615,17 @@ var interfaceColController = function (_baseController) {
}, {
key: 'upCol',
value: function () {
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(ctx) {
var params, _id4, colData, auth, result;
var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(ctx) {
var params, id, colData, auth, result, username;
return _regenerator2.default.wrap(function _callee7$(_context7) {
while (1) {
switch (_context7.prev = _context7.next) {
case 0:
_context7.prev = 0;
params = ctx.request.body;
_id4 = params.col_id;
id = params.col_id;
_context7.next = 5;
return this.colModel.get(_id4);
return this.colModel.get(id);
case 5:
colData = _context7.sent;
@ -623,23 +652,31 @@ var interfaceColController = function (_baseController) {
case 13:
result = _context7.sent;
username = this.getUsername();
_yapi2.default.commons.saveLog({
content: '\u7528\u6237 "' + username + '" \u66F4\u65B0\u4E86\u63A5\u53E3\u96C6 "' + params.name + '" \u7684\u4FE1\u606F',
type: 'project',
uid: this.getUid(),
username: username,
typeid: colData.project_id
});
ctx.body = _yapi2.default.commons.resReturn(result);
_context7.next = 20;
_context7.next = 22;
break;
case 17:
_context7.prev = 17;
case 19:
_context7.prev = 19;
_context7.t0 = _context7['catch'](0);
ctx.body = _yapi2.default.commons.resReturn(null, 400, _context7.t0.message);
case 20:
case 22:
case 'end':
return _context7.stop();
}
}
}, _callee7, this, [[0, 17]]);
}, _callee7, this, [[0, 19]]);
}));
function upCol(_x7) {
@ -663,7 +700,7 @@ var interfaceColController = function (_baseController) {
}, {
key: 'upCaseIndex',
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 _this2 = this;
var params;
@ -722,17 +759,16 @@ var interfaceColController = function (_baseController) {
}, {
key: 'delCol',
value: function () {
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(ctx) {
var _id5, colData, auth, result;
var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(ctx) {
var id, colData, auth, result;
return _regenerator2.default.wrap(function _callee9$(_context9) {
while (1) {
switch (_context9.prev = _context9.next) {
case 0:
_context9.prev = 0;
_id5 = ctx.query.col_id;
id = ctx.query.col_id;
_context9.next = 4;
return this.colModel.get(_id5);
return this.colModel.get(id);
case 4:
colData = _context9.sent;
@ -761,12 +797,12 @@ var interfaceColController = function (_baseController) {
case 12:
_context9.next = 14;
return this.colModel.del(_id5);
return this.colModel.del(id);
case 14:
result = _context9.sent;
_context9.next = 17;
return this.caseModel.delByCol(_id5);
return this.caseModel.delByCol(id);
case 17:
return _context9.abrupt('return', ctx.body = _yapi2.default.commons.resReturn(result));
@ -800,7 +836,7 @@ var interfaceColController = function (_baseController) {
}, {
key: 'delCase',
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 caseid, caseData, auth, result;
return _regenerator2.default.wrap(function _callee10$(_context10) {
while (1) {

View File

@ -75,7 +75,7 @@ var logController = function (_baseController) {
(0, _createClass3.default)(logController, [{
key: 'list',
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 typeid, page, limit, type, result, count;
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {

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 params, check, result, username, project, member;
return _regenerator2.default.wrap(function _callee3$(_context3) {
while (1) {
@ -548,7 +548,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) {
@ -606,7 +606,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) {
@ -668,7 +668,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) {
@ -753,7 +753,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) {
@ -853,7 +853,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) {
@ -946,7 +946,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 params, projectInst, check, result, username, project, member;
return _regenerator2.default.wrap(function _callee9$(_context9) {
while (1) {
@ -1068,7 +1068,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 id, data, result;
return _regenerator2.default.wrap(function _callee10$(_context10) {
while (1) {
@ -1147,7 +1147,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) {
@ -1294,7 +1294,7 @@ var projectController = function (_baseController) {
}, {
key: 'upSet',
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 id, data, auth, result;
return _regenerator2.default.wrap(function _callee12$(_context12) {
while (1) {
@ -1381,7 +1381,7 @@ var projectController = function (_baseController) {
}, {
key: 'search',
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 q, projectList, groupList, projectRules, groupRules, queryList;
return _regenerator2.default.wrap(function _callee13$(_context13) {
while (1) {
@ -1456,7 +1456,7 @@ var projectController = function (_baseController) {
}, {
key: 'download',
value: function () {
var _ref14 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14(ctx) {
var _ref14 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee14(ctx) {
var project_id, interfaceInst, count, arr, fileName, res;
return _regenerator2.default.wrap(function _callee14$(_context14) {
while (1) {

View File

@ -99,7 +99,7 @@ var userController = function (_baseController) {
(0, _createClass3.default)(userController, [{
key: 'login',
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 userInst, email, password, result;
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
@ -190,7 +190,7 @@ var userController = function (_baseController) {
}, {
key: 'logout',
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) {
return _regenerator2.default.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
@ -248,7 +248,7 @@ var userController = function (_baseController) {
}, {
key: 'loginByToken',
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 config, token, ret, login;
return _regenerator2.default.wrap(function _callee3$(_context3) {
while (1) {
@ -300,7 +300,7 @@ var userController = function (_baseController) {
}, {
key: 'handleThirdLogin',
value: function () {
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(email, username) {
var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(email, username) {
var user, data, passsalt, userInst;
return _regenerator2.default.wrap(function _callee4$(_context4) {
while (1) {
@ -384,7 +384,7 @@ var userController = function (_baseController) {
}, {
key: 'changePassword',
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, userInst, user, passsalt, data, result;
return _regenerator2.default.wrap(function _callee5$(_context5) {
while (1) {
@ -512,7 +512,7 @@ var userController = function (_baseController) {
}, {
key: 'reg',
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 userInst, params, checkRepeat, passsalt, data, user;
return _regenerator2.default.wrap(function _callee6$(_context6) {
while (1) {
@ -636,7 +636,7 @@ var userController = 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 page, limit, userInst, user, count;
return _regenerator2.default.wrap(function _callee7$(_context7) {
while (1) {
@ -694,7 +694,7 @@ var userController = function (_baseController) {
}, {
key: 'findById',
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 userInst, id, result;
return _regenerator2.default.wrap(function _callee8$(_context8) {
while (1) {
@ -770,7 +770,7 @@ var userController = function (_baseController) {
}, {
key: 'del',
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 userInst, id, result;
return _regenerator2.default.wrap(function _callee9$(_context9) {
while (1) {
@ -846,7 +846,7 @@ var userController = function (_baseController) {
}, {
key: 'update',
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 params, userInst, id, data, checkRepeat, result;
return _regenerator2.default.wrap(function _callee10$(_context10) {
while (1) {
@ -952,7 +952,7 @@ var userController = function (_baseController) {
}, {
key: 'uploadAvatar',
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 basecode, pngPrefix, jpegPrefix, type, strLength, avatarInst, result;
return _regenerator2.default.wrap(function _callee11$(_context11) {
while (1) {
@ -1054,7 +1054,7 @@ var userController = function (_baseController) {
}, {
key: 'avatar',
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 uid, avatarInst, data, dataBuffer, type;
return _regenerator2.default.wrap(function _callee12$(_context12) {
while (1) {
@ -1118,7 +1118,7 @@ var userController = function (_baseController) {
}, {
key: 'search',
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 q, queryList, rules, filteredRes;
return _regenerator2.default.wrap(function _callee13$(_context13) {
while (1) {
@ -1190,7 +1190,7 @@ var userController = function (_baseController) {
}, {
key: 'project',
value: function () {
var _ref14 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14(ctx) {
var _ref14 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee14(ctx) {
var _ctx$request$query, id, type, result, interfaceInst, interfaceData, projectInst, projectData, ownerAuth, devAuth, groupInst, groupData, _ownerAuth, _devAuth;
return _regenerator2.default.wrap(function _callee14$(_context14) {

View File

@ -47,7 +47,7 @@ function matchApi(apiPath, apiRule) {
}
module.exports = function () {
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx, next) {
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx, next) {
var hostname, config, path, paths, projectId, projectInst, project, interfaceData, newData, newpath, interfaceInst, _newData, findInterface, res;
return _regenerator2.default.wrap(function _callee$(_context) {

View File

@ -355,7 +355,7 @@ function createAction(controller, action, path, method) {
var _this = this;
router[method]("/api" + INTERFACE_CONFIG[controller].prefix + path, 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 inst;
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {

View File

@ -26,7 +26,7 @@ function websocket(app) {
return next(ctx);
});
router.get('/api/interface/solve_conflict', 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 inst;
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {