fix: 企业登录拒绝 SUPER_ADMIN + authMiddleware 校验 orgId 非空,修复 500 错误

This commit is contained in:
selfrelease
2026-07-29 12:01:14 +08:00
parent b1d2d5715d
commit b7e617cd0d
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -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() },