fix: 修复系统一致性与安全问题
This commit is contained in:
1 parent
aaeec14733
commit
f158f906d5
19 files changed
+194
-34
No files matched your search
@@ -19,6 +19,12 @@ export class AdminAccessService {
|
||||
throw new UnauthorizedException("管理员登录态无效或已过期");
|
||||
}
|
||||
if (identity.role !== "admin") throw new ForbiddenException("无管理员权限");
|
||||
const user = await this.prisma.adminUser.findUnique({
|
||||
where: { id: identity.subject },
|
||||
select: { mustChangePassword: true },
|
||||
});
|
||||
if (!user || user.mustChangePassword)
|
||||
throw new ForbiddenException("请先完成初始密码修改后再访问管理后台");
|
||||
const membership = await this.prisma.brandMembership.findUnique({
|
||||
where: { adminUserId_brandId: { adminUserId: identity.subject, brandId: identity.brandId } },
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user