hrjy преди 2 години
родител
ревизия
ef2c92fd34
променени са 1 файла, в които са добавени 13 реда и са изтрити 13 реда
  1. 13 13
      app/api/controller/AuthController.php

+ 13 - 13
app/api/controller/AuthController.php

@@ -129,19 +129,19 @@ class AuthController
     {
         list($phone, $type, $key, $code) = UtilService::postMore([['phone', 0], ['type', ''], ['key', ''], ['code', '']], $request, true);
 
-        $keyName = 'sms.key.' . $key;
+//        $keyName = 'sms.key.' . $key;
         $nowKey = 'sms.' . date('YmdHi');
-
-        if (!Cache::has($keyName))
-            return app('json')->make(401, '发送验证码失败');
-
-        if (($num = Cache::get($keyName)) > 2) {
-            if (!$code)
-                return app('json')->make(402, '请输入验证码');
-
-            if (!$this->checkCaptcha($key, $code))
-                return app('json')->fail('验证码输入有误');
-        }
+//
+//        if (!Cache::has($keyName))
+//            return app('json')->make(401, '发送验证码失败');
+//
+//        if (($num = Cache::get($keyName)) > 2) {
+//            if (!$code)
+//                return app('json')->make(402, '请输入验证码');
+//
+//            if (!$this->checkCaptcha($key, $code))
+//                return app('json')->fail('验证码输入有误');
+//        }
 
         $total = 1;
         if ($has = Cache::has($nowKey)) {
@@ -177,7 +177,7 @@ class AuthController
         if ($res !== true)
             return app('json')->fail('短信平台验证码发送失败' . $res);
         CacheService::set('code_' . $phone, $code, $time);
-        Cache::set($keyName, $num + 1, 300);
+//        Cache::set($keyName, $num + 1, 300);
         Cache::set($nowKey, $total, 61);
 
         return app('json')->success('发送成功');