mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-30 13:20:24 +08:00
fix: 修改日志错误
This commit is contained in:
parent
7e85579220
commit
38a518ff7f
@ -1 +1 @@
|
||||
module.exports = {qsso : require('plugins/yapi-plugin-qsso/client.js')}
|
||||
module.exports = {}
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user