提交 e8f4a74c 编写于 作者: 雪洛's avatar 雪洛

fix: captcha required error

上级 b6d0137f
......@@ -52,6 +52,11 @@ module.exports = async function (params = {}) {
type: LOG_TYPE.RESET_PWD_BY_EMAIL
})
if (needCaptcha) {
if (!captcha) {
throw {
errCode: ERROR.CAPTCHA_REQUIRED
}
}
await verifyCaptcha.call(this, {
captcha,
scene: CAPTCHA_SCENE.RESET_PWD_BY_EMAIL
......
......@@ -52,6 +52,11 @@ module.exports = async function (params = {}) {
type: LOG_TYPE.RESET_PWD_BY_SMS
})
if (needCaptcha) {
if (!captcha) {
throw {
errCode: ERROR.CAPTCHA_REQUIRED
}
}
await verifyCaptcha.call(this, {
captcha,
scene: CAPTCHA_SCENE.RESET_PWD_BY_SMS
......
......@@ -14,6 +14,9 @@ const {
SMS_SCENE,
LOG_TYPE
} = require('../../common/constants')
const {
ERROR
} = require('../../common/error')
/**
* 短信验证码登录
......@@ -51,6 +54,11 @@ module.exports = async function (params = {}) {
})
if (needCaptcha) {
if (!captcha) {
throw {
errCode: ERROR.CAPTCHA_REQUIRED
}
}
await verifyCaptcha.call(this, {
captcha,
scene: CAPTCHA_SCENE.LOGIN_BY_SMS
......
......@@ -71,6 +71,11 @@ module.exports = async function (params = {}) {
email
})
if (needCaptcha) {
if (!captcha) {
throw {
errCode: ERROR.CAPTCHA_REQUIRED
}
}
await verifyCaptcha.call(this, {
captcha,
scene: CAPTCHA_SCENE.LOGIN_BY_PWD
......
......@@ -14,6 +14,9 @@ const {
preBind,
postBind
} = require('../../lib/utils/relate')
const {
ERROR
} = require('../../common/error')
/**
* 通过短信验证码绑定手机号
......@@ -47,6 +50,11 @@ module.exports = async function (params = {}) {
type: LOG_TYPE.BIND_MOBILE
})
if (needCaptcha) {
if (!captcha) {
throw {
errCode: ERROR.CAPTCHA_REQUIRED
}
}
await verifyCaptcha.call(this, {
captcha,
scene: CAPTCHA_SCENE.BIND_MOBILE_BY_SMS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册