From ad50d6469f13ac5340b39bf55026cde214b9c873 Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 23 Sep 2019 14:41:43 +0800 Subject: [PATCH] Update ExtendService.php --- application/store/service/ExtendService.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/application/store/service/ExtendService.php b/application/store/service/ExtendService.php index 8e52d7ab2..cbf87740c 100644 --- a/application/store/service/ExtendService.php +++ b/application/store/service/ExtendService.php @@ -84,11 +84,7 @@ class ExtendService if (empty($content) || stripos($content, '{code}') === false) { $content = '您的验证码为{code},请在十分钟内完成操作!'; } - cache($ckey, ['phone' => $phone, 'code' => $code, 'time' => time()], 600); - if (empty($content) || strpos($content, '{code}') === false) { - return [0, '获取短信模板失败,联系管理员配置!', []]; - } - $cache = cache($ckey); + cache($ckey, $cache = ['phone' => $phone, 'code' => $code, 'time' => time()], 600); if (self::sendChinaSms($mid, $phone, str_replace('{code}', $code, $content))) { $dtime = ($cache['time'] + $wait < time()) ? 0 : ($wait - time() + $cache['time']); return [1, '短信验证码发送成功!', ['time' => $dtime]];