fix: 企业登录拒绝 SUPER_ADMIN + authMiddleware 校验 orgId 非空,修复 500 错误
This commit is contained in:
@@ -94,6 +94,10 @@ export async function login(phone: string, password: string) {
|
||||
throw { code: 'ACCOUNT_DISABLED', message: '该账号已被禁用,请联系管理员' }
|
||||
}
|
||||
|
||||
if (user.role === 'SUPER_ADMIN') {
|
||||
throw { code: 'FORBIDDEN', message: '平台管理员请使用平台管理入口登录' }
|
||||
}
|
||||
|
||||
await prisma.user.update({
|
||||
where: { id: user.id },
|
||||
data: { lastLoginAt: new Date() },
|
||||
|
||||
Reference in New Issue
Block a user