m
This commit is contained in:
+6
-4
@@ -26,11 +26,13 @@ class CommonCaptchaController {
|
||||
this.captchaService = captchaService;
|
||||
}
|
||||
async getCaptcha(query) {
|
||||
const type = query.type ?? 'text';
|
||||
const size = query.size ?? 4;
|
||||
const result = type === 'math'
|
||||
? await this.captchaService.generateMath()
|
||||
: await this.captchaService.generate({ size });
|
||||
const color = query.color ?? '#028304';
|
||||
const result = await this.captchaService.generate({
|
||||
size,
|
||||
noise: 4,
|
||||
color,
|
||||
});
|
||||
return api_1.Api.success({
|
||||
svg: result.svg,
|
||||
key: result.key,
|
||||
|
||||
Reference in New Issue
Block a user