|
|
@ -29,13 +29,6 @@ router.post('/sendverifycode', async (req, res) => { |
|
|
|
|
|
|
|
|
|
|
|
let data = {code: 0, message: ''}; |
|
|
|
let data = {code: 0, message: ''}; |
|
|
|
|
|
|
|
|
|
|
|
if (!phoneNumber || !codeNumber || !sign) { |
|
|
|
|
|
|
|
data.message = '参数不能为空'; |
|
|
|
|
|
|
|
}else if (common.isPhoneNumber(phoneNumber) == false) { |
|
|
|
|
|
|
|
data.message = '手机号码格式错误'; |
|
|
|
|
|
|
|
}else if (common.isVerifyCode(codeNumber) == false) { |
|
|
|
|
|
|
|
data.message = '验证码格式错误,必须是4位数的数字'; |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
//使用默认配置
|
|
|
|
//使用默认配置
|
|
|
|
let myConfig = defaultConfig; |
|
|
|
let myConfig = defaultConfig; |
|
|
|
|
|
|
|
|
|
|
@ -47,6 +40,14 @@ router.post('/sendverifycode', async (req, res) => { |
|
|
|
//使用自定义配置
|
|
|
|
//使用自定义配置
|
|
|
|
myConfig = customConfig; |
|
|
|
myConfig = customConfig; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!phoneNumber || !codeNumber || !sign) { |
|
|
|
|
|
|
|
data.message = '参数不能为空'; |
|
|
|
|
|
|
|
}else if (common.isPhoneNumber(phoneNumber) == false) { |
|
|
|
|
|
|
|
data.message = '手机号码格式错误'; |
|
|
|
|
|
|
|
}else if (common.isVerifyCode(codeNumber) == false) { |
|
|
|
|
|
|
|
data.message = '验证码格式错误,必须是4位数的数字'; |
|
|
|
|
|
|
|
}else { |
|
|
|
let paramsCheck = {}; |
|
|
|
let paramsCheck = {}; |
|
|
|
for (const key in req.body) { |
|
|
|
for (const key in req.body) { |
|
|
|
if (key != 'sign') { |
|
|
|
if (key != 'sign') { |
|
|
|