验证码区分mobile与email
This commit is contained in:
parent
8ba03c64b5
commit
24ccac2059
|
|
@ -606,7 +606,8 @@ export async function loginByMobile<ED extends EntityDict>(
|
|||
expired: 1,
|
||||
},
|
||||
filter: {
|
||||
mobile,
|
||||
origin: 'mobile',
|
||||
content: mobile,
|
||||
code: captcha,
|
||||
},
|
||||
sorter: [
|
||||
|
|
@ -1574,7 +1575,8 @@ export async function sendCaptcha<ED extends EntityDict>(
|
|||
'captcha',
|
||||
{
|
||||
filter: {
|
||||
mobile,
|
||||
origin: 'mobile',
|
||||
content: mobile,
|
||||
$$createAt$$: {
|
||||
$gt: now - 3600 * 1000,
|
||||
},
|
||||
|
|
@ -1600,7 +1602,8 @@ export async function sendCaptcha<ED extends EntityDict>(
|
|||
$$createAt$$: 1,
|
||||
},
|
||||
filter: {
|
||||
mobile,
|
||||
origin: 'mobile',
|
||||
content: mobile,
|
||||
$$createAt$$: {
|
||||
$gt: now - duration * 60 * 1000,
|
||||
},
|
||||
|
|
@ -1657,7 +1660,8 @@ export async function sendCaptcha<ED extends EntityDict>(
|
|||
action: 'create',
|
||||
data: {
|
||||
id,
|
||||
mobile,
|
||||
origin: 'mobile',
|
||||
content: mobile,
|
||||
code,
|
||||
visitorId,
|
||||
env,
|
||||
|
|
|
|||
|
|
@ -326,7 +326,8 @@ export async function updateUserPassword<ED extends EntityDict>(params: { userId
|
|||
id: 1,
|
||||
},
|
||||
filter: {
|
||||
mobile,
|
||||
origin: 'mobile',
|
||||
content: mobile,
|
||||
code: captcha,
|
||||
expired: false,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ export async function unbindingWechat<ED extends EntityDict>(
|
|||
expired: 1,
|
||||
},
|
||||
filter: {
|
||||
mobile,
|
||||
origin: 'mobile',
|
||||
content: mobile,
|
||||
code: captcha,
|
||||
},
|
||||
sorter: [{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ import { ActionDef, Index } from 'oak-domain/lib/types';
|
|||
import { EntityDesc } from 'oak-domain/lib/types/EntityDesc';
|
||||
|
||||
export interface Schema extends EntityShape {
|
||||
mobile: String<11>;
|
||||
origin: 'mobile' | 'email';
|
||||
content: String<32>;
|
||||
code: String<4>;
|
||||
visitorId: Text;
|
||||
reason?: Text;
|
||||
|
|
@ -36,7 +37,8 @@ export const entityDesc: EntityDesc<Schema, Action, '', {
|
|||
zh_CN: {
|
||||
name: '验证码',
|
||||
attr: {
|
||||
mobile: '手机号',
|
||||
origin: '源',
|
||||
content: '内容',
|
||||
code: '验证码',
|
||||
visitorId: '用户标识',
|
||||
reason: '失败原因',
|
||||
|
|
@ -71,7 +73,7 @@ export const entityDesc: EntityDesc<Schema, Action, '', {
|
|||
name: 'index_mobile_code',
|
||||
attributes: [
|
||||
{
|
||||
name: 'mobile',
|
||||
name: 'content',
|
||||
direction: 'ASC',
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue