验证码登录成功就失效
This commit is contained in:
parent
641ffd4b1f
commit
faee5e9f3a
|
|
@ -470,6 +470,16 @@ export async function loginByMobile(params, context) {
|
|||
throw new OakUserException('验证码已经过期');
|
||||
}
|
||||
// 到这里说明验证码已经通过
|
||||
await context.operate('captcha', {
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'update',
|
||||
data: {
|
||||
expired: true
|
||||
},
|
||||
filter: {
|
||||
id: captchaRow.id
|
||||
}
|
||||
}, {});
|
||||
return await setupMobile(mobile, env, context);
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -474,6 +474,16 @@ async function loginByMobile(params, context) {
|
|||
throw new types_1.OakUserException('验证码已经过期');
|
||||
}
|
||||
// 到这里说明验证码已经通过
|
||||
await context.operate('captcha', {
|
||||
id: await (0, uuid_1.generateNewIdAsync)(),
|
||||
action: 'update',
|
||||
data: {
|
||||
expired: true
|
||||
},
|
||||
filter: {
|
||||
id: captchaRow.id
|
||||
}
|
||||
}, {});
|
||||
return await setupMobile(mobile, env, context);
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -642,6 +642,20 @@ export async function loginByMobile<ED extends EntityDict>(
|
|||
if (captchaRow.expired) {
|
||||
throw new OakUserException('验证码已经过期');
|
||||
}
|
||||
await context.operate(
|
||||
'captcha',
|
||||
{
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'update',
|
||||
data: {
|
||||
expired: true
|
||||
},
|
||||
filter: {
|
||||
id: captchaRow.id!
|
||||
}
|
||||
},
|
||||
{}
|
||||
);
|
||||
|
||||
// 到这里说明验证码已经通过
|
||||
return await setupMobile<ED>(mobile, env, context);
|
||||
|
|
|
|||
Loading…
Reference in New Issue