perf: 禁用readonly用户

pull/229/head
xiaojunnuo 2024-10-27 00:04:02 +08:00
parent b780eab5f5
commit d10d42e206
3 changed files with 21 additions and 0 deletions

View File

@ -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",

View File

@ -0,0 +1,3 @@
update sys_user set status = 0 where id = 2;

View File

@ -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);