feat: 完成模板目录导入与生命周期管理

This commit is contained in:
que01 committed 2026-10-16 16:34:24 +08:00
1 parent 553a07c4ec
commit 413413efda
25 files changed
+1313 -24

No files matched your search

+8 -1
View File
@@ -10,7 +10,13 @@ export class AdminAuthService {
async login(
username: string,
password: string,
): Promise<{ token: string; displayName: string; mustChangePassword: boolean; role: string }> {
): Promise<{
token: string;
displayName: string;
mustChangePassword: boolean;
role: string;
platformTemplateRole: string;
}> {
const user = await this.prisma.adminUser.findUnique({ where: { username } });
if (!user || !user.isEnabled || !(await bcrypt.compare(password, user.passwordHash))) {
throw new UnauthorizedException("账号或密码错误");
@@ -41,6 +47,7 @@ export class AdminAuthService {
displayName: user.displayName,
mustChangePassword: user.mustChangePassword,
role: activeMembership.role,
platformTemplateRole: user.platformTemplateRole,
};
}