Просмотр исходного кода

修复:checkSMS验证不正确(数据类型问题)

Yahoo 4 лет назад
Родитель
Сommit
b081eb7030

+ 6 - 6
composer.lock

@@ -2564,16 +2564,16 @@
         },
         {
             "name": "yiovo/tp6-captcha",
-            "version": "v1.1.1",
+            "version": "v1.1.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/yiovo/tp6-captcha.git",
-                "reference": "ee3580516de48500cd02bcea01031eb6cb9f7d2d"
+                "reference": "33a00cbf9c94fc0cbd6636e4c6cb6642d12dfd27"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/yiovo/tp6-captcha/zipball/ee3580516de48500cd02bcea01031eb6cb9f7d2d",
-                "reference": "ee3580516de48500cd02bcea01031eb6cb9f7d2d",
+                "url": "https://api.github.com/repos/yiovo/tp6-captcha/zipball/33a00cbf9c94fc0cbd6636e4c6cb6642d12dfd27",
+                "reference": "33a00cbf9c94fc0cbd6636e4c6cb6642d12dfd27",
                 "shasum": ""
             },
             "require": {
@@ -2609,9 +2609,9 @@
             "description": "tp6-captcha",
             "homepage": "https://github.com/yiovo/tp6-captcha",
             "support": {
-                "source": "https://github.com/yiovo/tp6-captcha/tree/v1.1.1"
+                "source": "https://github.com/yiovo/tp6-captcha/tree/v1.1.2"
             },
-            "time": "2021-11-27T19:12:51+00:00"
+            "time": "2021-12-02T13:49:15+00:00"
         }
     ],
     "packages-dev": [

+ 1 - 1
vendor/composer/autoload_files.php

@@ -74,7 +74,7 @@ return array(
     '4888a6f58c08148ebe17682f9ce9b2a8' => $vendorDir . '/markbaker/matrix/classes/src/Operations/divideby.php',
     'eef6fa3879d3efa347cd24d5eb348f85' => $vendorDir . '/markbaker/matrix/classes/src/Operations/divideinto.php',
     '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
+    'cd5441689b14144e5573bf989ee47b34' => $vendorDir . '/qcloud/cos-sdk-v5/src/Common.php',
     '841780ea2e1d6545ea3a253239d59c05' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/functions.php',
     '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
-    'cd5441689b14144e5573bf989ee47b34' => $vendorDir . '/qcloud/cos-sdk-v5/src/Common.php',
 );

+ 1 - 1
vendor/composer/autoload_static.php

@@ -75,9 +75,9 @@ class ComposerStaticInitb17d9cf9df517c3dd2f492a1c933c315
         '4888a6f58c08148ebe17682f9ce9b2a8' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operations/divideby.php',
         'eef6fa3879d3efa347cd24d5eb348f85' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/Operations/divideinto.php',
         '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
+        'cd5441689b14144e5573bf989ee47b34' => __DIR__ . '/..' . '/qcloud/cos-sdk-v5/src/Common.php',
         '841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php',
         '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
-        'cd5441689b14144e5573bf989ee47b34' => __DIR__ . '/..' . '/qcloud/cos-sdk-v5/src/Common.php',
     );
 
     public static $prefixLengthsPsr4 = array (

+ 7 - 7
vendor/composer/installed.json

@@ -2909,17 +2909,17 @@
         },
         {
             "name": "yiovo/tp6-captcha",
-            "version": "v1.1.1",
-            "version_normalized": "1.1.1.0",
+            "version": "v1.1.2",
+            "version_normalized": "1.1.2.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/yiovo/tp6-captcha.git",
-                "reference": "ee3580516de48500cd02bcea01031eb6cb9f7d2d"
+                "reference": "33a00cbf9c94fc0cbd6636e4c6cb6642d12dfd27"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/yiovo/tp6-captcha/zipball/ee3580516de48500cd02bcea01031eb6cb9f7d2d",
-                "reference": "ee3580516de48500cd02bcea01031eb6cb9f7d2d",
+                "url": "https://api.github.com/repos/yiovo/tp6-captcha/zipball/33a00cbf9c94fc0cbd6636e4c6cb6642d12dfd27",
+                "reference": "33a00cbf9c94fc0cbd6636e4c6cb6642d12dfd27",
                 "shasum": ""
             },
             "require": {
@@ -2929,7 +2929,7 @@
                 "topthink/framework": "^6.0.0",
                 "yiovo/tp6-cache": "^1.0"
             },
-            "time": "2021-11-27T19:12:51+00:00",
+            "time": "2021-12-02T13:49:15+00:00",
             "type": "library",
             "extra": {
                 "think": {
@@ -2957,7 +2957,7 @@
             "description": "tp6-captcha",
             "homepage": "https://github.com/yiovo/tp6-captcha",
             "support": {
-                "source": "https://github.com/yiovo/tp6-captcha/tree/v1.1.1"
+                "source": "https://github.com/yiovo/tp6-captcha/tree/v1.1.2"
             },
             "install-path": "../yiovo/tp6-captcha"
         }

+ 5 - 5
vendor/composer/installed.php

@@ -5,7 +5,7 @@
         'type' => 'project',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
-        'reference' => 'd47d03901df3775835529be3426db7138e4b0c05',
+        'reference' => '782339b41b2d8e189e7b084e361548a66eb2242e',
         'name' => 'topthink/think',
         'dev' => true,
     ),
@@ -340,7 +340,7 @@
             'type' => 'project',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),
-            'reference' => 'd47d03901df3775835529be3426db7138e4b0c05',
+            'reference' => '782339b41b2d8e189e7b084e361548a66eb2242e',
             'dev_requirement' => false,
         ),
         'topthink/think-helper' => array(
@@ -416,12 +416,12 @@
             'dev_requirement' => false,
         ),
         'yiovo/tp6-captcha' => array(
-            'pretty_version' => 'v1.1.1',
-            'version' => '1.1.1.0',
+            'pretty_version' => 'v1.1.2',
+            'version' => '1.1.2.0',
             'type' => 'library',
             'install_path' => __DIR__ . '/../yiovo/tp6-captcha',
             'aliases' => array(),
-            'reference' => 'ee3580516de48500cd02bcea01031eb6cb9f7d2d',
+            'reference' => '33a00cbf9c94fc0cbd6636e4c6cb6642d12dfd27',
             'dev_requirement' => false,
         ),
     ),

+ 1 - 1
vendor/services.php

@@ -1,5 +1,5 @@
 <?php 
-// This file is automatically generated at:2021-12-01 19:36:31
+// This file is automatically generated at:2021-12-02 21:52:02
 declare (strict_types = 1);
 return array (
   0 => 'think\\app\\Service',

+ 4 - 4
vendor/yiovo/tp6-captcha/src/CaptchaApi.php

@@ -75,9 +75,9 @@ class CaptchaApi
      */
     public function createSMS(string $phone): array
     {
-        $key = rand(100000, 999999);
-        $this->cache->set("captchaSMS.{$phone}", ['code' => $key, 'times' => $this->checkTimes], $this->expire);
-        return ['key' => $phone, 'code' => $key];
+        $code = (string)mt_rand(100000, 999999);
+        $this->cache->set("captchaSMS.{$phone}", ['code' => $code, 'times' => $this->checkTimes], $this->expire);
+        return ['key' => $phone, 'code' => $code];
     }
 
     /**
@@ -97,7 +97,7 @@ class CaptchaApi
             $this->cache->delete("captchaSMS.{$phone}");
             $this->throwError('短信验证码已超出错误次数,请重新获取');
         }
-        if ($captcha['code'] !== $code) {
+        if ($captcha['code'] != $code) {
             $this->cache->update("captchaSMS.{$phone}", ['times' => $captcha['times'] - 1]);
             return false;
         }