mirror of
https://github.com/certd/certd.git
synced 2026-04-15 21:40:53 +08:00
feat: 手机号登录、邮箱验证码注册
This commit is contained in:
@@ -88,7 +88,7 @@ export class CodeService {
|
||||
/**
|
||||
*/
|
||||
async sendEmailCode(email: string, randomStr: string) {
|
||||
console.assert(!email, '手机号不能为空');
|
||||
console.assert(!email, 'Email不能为空');
|
||||
console.assert(!randomStr, 'randomStr不能为空');
|
||||
|
||||
const code = randomNumber(4);
|
||||
@@ -98,7 +98,7 @@ export class CodeService {
|
||||
receivers: [email],
|
||||
});
|
||||
|
||||
const key = this.buildEmailCodeKey(email, code);
|
||||
const key = this.buildEmailCodeKey(email, randomStr);
|
||||
cache.set(key, code, {
|
||||
ttl: 5 * 60 * 1000, //5分钟
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AliyunAccess, AliyunClient } from '@certd/plugin-plus';
|
||||
import { logger } from '@certd/basic';
|
||||
import { ISmsService, PluginInputs, SmsPluginCtx } from './api.js';
|
||||
import { AliyunAccess, AliyunClient } from '@certd/plugin-lib';
|
||||
export type AliyunSmsConfig = {
|
||||
accessId: string;
|
||||
regionId: string;
|
||||
|
||||
Reference in New Issue
Block a user