perf: 禁用readonly用户

This commit is contained in:
xiaojunnuo
2024-10-27 00:04:02 +08:00
parent b780eab5f5
commit d10d42e206
3 changed files with 21 additions and 0 deletions

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