diff --git a/conf/app.php b/conf/app.php index 7b25ff8..9ab6d76 100644 --- a/conf/app.php +++ b/conf/app.php @@ -125,6 +125,7 @@ $configs = array( //源码下载:https://git.filesite.io/filesite/service-3rd 'service_3rd_api_domain' => 'https://service.filesite.io', 'service_3rd_api_key' => '你的密钥', + 'sms_code_cache_time' => 600, //短信验证码缓存时长,单位:秒 ); diff --git a/themes/tajian/controller/FrontapiController.php b/themes/tajian/controller/FrontapiController.php index 6b23688..3b84cb0 100644 --- a/themes/tajian/controller/FrontapiController.php +++ b/themes/tajian/controller/FrontapiController.php @@ -453,7 +453,8 @@ eof; $rndCode_created = !empty($_SESSION['randSmsCode_created']) ? $_SESSION['randSmsCode_created'] : 0; $current_time = time(); - if (!empty($rndCode_created) && $current_time - $rndCode_created > 600) { + $max_cache_time = !empty(FSC::$app['config']['sms_code_cache_time']) ? FSC::$app['config']['sms_code_cache_time'] : 600; + if (!empty($rndCode_created) && $current_time - $rndCode_created > $max_cache_time) { $rndCode = 0; }