mirror of
https://github.com/certd/certd.git
synced 2026-07-15 18:27:33 +08:00
feat: 通过插件配置懒加载依赖,动态加载第三方依赖包,精简安装镜像大小
This commit is contained in:
@@ -6,6 +6,7 @@ import { SmsServiceFactory } from "../sms/factory.js";
|
||||
import { CaptchaService } from "./captcha-service.js";
|
||||
import { EmailService } from "./email-service.js";
|
||||
import { CaptchaRequest } from "../../../plugins/plugin-captcha/api.js";
|
||||
import { RuntimeDepsService } from "../../runtime-deps/runtime-deps-service.js";
|
||||
|
||||
// {data: '<svg.../svg>', text: 'abcd'}
|
||||
/**
|
||||
@@ -24,6 +25,9 @@ export class CodeService {
|
||||
@Inject()
|
||||
captchaService: CaptchaService;
|
||||
|
||||
@Inject()
|
||||
runtimeDepsService: RuntimeDepsService;
|
||||
|
||||
async checkCaptcha(body: any, req: CaptchaRequest) {
|
||||
return await this.captchaService.doValidate({ form: body, req });
|
||||
}
|
||||
@@ -53,9 +57,10 @@ export class CodeService {
|
||||
const smsConfig = sysSettings.sms.config;
|
||||
const sender: ISmsService = await SmsServiceFactory.createSmsService(smsType);
|
||||
const accessGetter = new AccessSysGetter(this.accessService);
|
||||
sender.setCtx({
|
||||
await sender.setCtx({
|
||||
accessService: accessGetter,
|
||||
config: smsConfig,
|
||||
runtimeDepsService: this.runtimeDepsService,
|
||||
});
|
||||
const smsCode = randomNumber(verificationCodeLength);
|
||||
await sender.sendSmsCode({
|
||||
|
||||
Reference in New Issue
Block a user