Merge branch 'v2-dev' of https://github.com/certd/certd into v2-dev

This commit is contained in:
xiaojunnuo
2025-12-25 22:20:59 +08:00
29 changed files with 1430 additions and 216 deletions
@@ -242,7 +242,9 @@ export class LoginService {
}
const info = await this.userService.findOne({id: oauthBound.userId});
if (info == null) {
throw new CommonException('用户不存在');
// 用户已被删除,删除此oauth绑定
await this.oauthBoundService.delete([oauthBound.id]);
return null
}
return this.generateToken(info);
}
@@ -1012,7 +1012,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
title: "申请证书",
runnableType: "step",
input: {
renewDays: 35,
renewDays: 18,
domains: req.domains,
email: req.email,
"challengeType": "auto",
@@ -13,6 +13,7 @@ import { RandomUtil } from '../../../../utils/random.js';
import dayjs from 'dayjs';
import { DbAdapter } from '../../../db/index.js';
import { simpleNanoId, utils } from '@certd/basic';
import { OauthBoundService } from '../../../login/service/oauth-bound-service.js';
export type RegisterType = 'username' | 'mobile' | 'email';
export type ForgotPasswordType = 'mobile' | 'email';
@@ -42,6 +43,10 @@ export class UserService extends BaseService<UserEntity> {
@Inject()
dbAdapter: DbAdapter;
@Inject()
oauthBoundService: OauthBoundService;
//@ts-ignore
getRepository() {
return this.repository;
@@ -311,6 +316,9 @@ export class UserService extends BaseService<UserEntity> {
throw new CommonException('不能删除管理员');
}
await super.delete(ids);
await this.oauthBoundService.deleteWhere({
userId: In(ids),
});
}
async isAdmin(userId: any) {