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