From a6f8d6d8e6c9ad71ddc21cc11ec5cfa989ab62af Mon Sep 17 00:00:00 2001 From: filesite Date: Wed, 5 Jun 2024 07:41:13 +0800 Subject: [PATCH] bug fix --- router_aliyun.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/router_aliyun.js b/router_aliyun.js index 016cc7e..40e0dac 100644 --- a/router_aliyun.js +++ b/router_aliyun.js @@ -29,6 +29,18 @@ router.post('/sendverifycode', async (req, res) => { let data = {code: 0, message: ''}; + //使用默认配置 + let myConfig = defaultConfig; + + //加载自定义配置 + if (!customConfig) { + customConfig = await getCustomConfigs('./conf/custom_config.json'); + } + + //使用自定义配置 + myConfig = customConfig; + + if (!phoneNumber || !codeNumber || !sign) { data.message = '参数不能为空'; }else if (common.isPhoneNumber(phoneNumber) == false) { @@ -36,17 +48,6 @@ router.post('/sendverifycode', async (req, res) => { }else if (common.isVerifyCode(codeNumber) == false) { data.message = '验证码格式错误,必须是4位数的数字'; }else { - //使用默认配置 - let myConfig = defaultConfig; - - //加载自定义配置 - if (!customConfig) { - customConfig = await getCustomConfigs('./conf/custom_config.json'); - } - - //使用自定义配置 - myConfig = customConfig; - let paramsCheck = {}; for (const key in req.body) { if (key != 'sign') {