fix: 修改日志错误

This commit is contained in:
喻希里 2017-09-29 17:02:01 +08:00
parent 7e85579220
commit 38a518ff7f
3 changed files with 20 additions and 16 deletions

View File

@ -1 +1 @@
module.exports = {qsso : require('plugins/yapi-plugin-qsso/client.js')}
module.exports = {}

View File

@ -200,13 +200,15 @@ class groupController extends baseController {
dev: "开发者",
guest: "访客"
};
yapi.commons.saveLog({
content: `用户 "${username}" 新增了分组成员 "${add_members.reduce((str, item) => (str ? str + '、' : '') + item.username, '')}" 为 "${rolename[params.role]}"`,
type: 'group',
uid: this.getUid(),
username: username,
typeid: params.id
});
if(add_members.length){
yapi.commons.saveLog({
content: `用户 "${username}" 新增了分组成员 "${add_members.reduce((str, item) => (str ? str + '、' : '') + item.username, '')}" 为 "${rolename[params.role]}"`,
type: 'group',
uid: this.getUid(),
username: username,
typeid: params.id
});
}
ctx.body = yapi.commons.resReturn({
result,
add_members,

View File

@ -203,14 +203,16 @@ class projectController extends baseController {
try {
let result = await this.Model.addMember(params.id, add_members);
let username = this.getUsername();
yapi.commons.saveLog({
content: `用户 "${username}" 添加了项目成员 "${add_members.reduce((str, item) => (str ? str + '、' : '') + item.username, '')}"`,
type: 'project',
uid: this.getUid(),
username: username,
typeid: params.id
});
if(add_members.length){
let username = this.getUsername();
yapi.commons.saveLog({
content: `用户 "${username}" 添加了项目成员 "${add_members.reduce((str, item) => (str ? str + '、' : '') + item.username, '')}"`,
type: 'project',
uid: this.getUid(),
username: username,
typeid: params.id
});
}
ctx.body = yapi.commons.resReturn({
result,
add_members,