mirror of https://github.com/certd/certd
perf: 禁用readonly用户
parent
b780eab5f5
commit
d10d42e206
|
@ -118,6 +118,21 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
|||
}
|
||||
}
|
||||
},
|
||||
status: {
|
||||
title: "状态",
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: "启用", value: 1, color: "green" },
|
||||
{ label: "禁用", value: 0, color: "red" }
|
||||
]
|
||||
}),
|
||||
column: {
|
||||
align: "center",
|
||||
sorter: true,
|
||||
width: 100
|
||||
}
|
||||
},
|
||||
remark: {
|
||||
title: "备注",
|
||||
type: "text",
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
update sys_user set status = 0 where id = 2;
|
||||
|
|
@ -35,6 +35,9 @@ export class LoginService {
|
|||
if (!right) {
|
||||
throw new CommonException('用户名或密码错误');
|
||||
}
|
||||
if (info.status === 0) {
|
||||
throw new CommonException('用户已被禁用');
|
||||
}
|
||||
|
||||
const roleIds = await this.roleService.getRoleIdsByUserId(info.id);
|
||||
return this.generateToken(info, roleIds);
|
||||
|
|
Loading…
Reference in New Issue