|
|
@ -48,10 +48,11 @@ async function creatUser(ctx, next) { |
|
|
|
password: Hex.stringify(MD5(data.password)), |
|
|
|
delete: false, |
|
|
|
}) |
|
|
|
const { judgeAgent } = ctx.app.fs.utils |
|
|
|
const userId = ctx.fs.api.userId; |
|
|
|
await models.OperationLog.create({ |
|
|
|
time: new Date().getTime(), |
|
|
|
clientType: ctx.header['user-agent'], |
|
|
|
clientType: judgeAgent(ctx.header['user-agent']), |
|
|
|
content: `新建用户:${data.name}`, |
|
|
|
parameter: null, |
|
|
|
userId, |
|
|
@ -96,10 +97,11 @@ async function updateUser(ctx, next) { |
|
|
|
where: { id } |
|
|
|
}); |
|
|
|
|
|
|
|
const { judgeAgent } = ctx.app.fs.utils |
|
|
|
const userId = ctx.fs.api.userId; |
|
|
|
await models.OperationLog.create({ |
|
|
|
time: new Date().getTime(), |
|
|
|
clientType: ctx.header['user-agent'], |
|
|
|
clientType: judgeAgent(ctx.header['user-agent']), |
|
|
|
content: `修改 (${data.name}) 用户信息`, |
|
|
|
parameter: null, |
|
|
|
userId, |
|
|
@ -129,11 +131,12 @@ async function deleteUser(ctx, next) { |
|
|
|
returning: true, |
|
|
|
}); |
|
|
|
|
|
|
|
const { judgeAgent } = ctx.app.fs.utils |
|
|
|
const userId = ctx.fs.api.userId; |
|
|
|
const userName = delUser[1].map(item => item.name).join() |
|
|
|
await models.OperationLog.create({ |
|
|
|
time: new Date().getTime(), |
|
|
|
clientType: ctx.header['user-agent'], |
|
|
|
clientType: judgeAgent(ctx.header['user-agent']), |
|
|
|
content: `删除用户:${userName}`, |
|
|
|
parameter: null, |
|
|
|
userId, |
|
|
@ -171,10 +174,11 @@ async function resetPwd(ctx, next) { |
|
|
|
returning: true, |
|
|
|
}, |
|
|
|
); |
|
|
|
const { judgeAgent } = ctx.app.fs.utils |
|
|
|
const userId = ctx.fs.api.userId; |
|
|
|
await models.OperationLog.create({ |
|
|
|
time: new Date().getTime(), |
|
|
|
clientType: ctx.header['user-agent'], |
|
|
|
clientType: judgeAgent(ctx.header['user-agent']), |
|
|
|
content: `修改 (${updateUser[1][0].name}) 用户密码`, |
|
|
|
parameter: null, |
|
|
|
userId, |
|
|
|