Tree 1 ヶ月 前
コミット
950ad891d4

+ 2 - 2
app/Game/Logics/SendCodeLogic.php

@@ -261,8 +261,8 @@ class SendCodeLogic extends BaseApiLogic
     {
         $len = strlen($phone);
         // 验证手机号格式
-        if (str_starts_with($phone, '55')) {
-            $len -= 2;
+        if (str_starts_with($phone, '1')) {
+            $len -= 1;
             if ($len < 9 || $len > 11) {
                 Log::info('手机长度问题 ' . $len);
                 $this->error = ['web.verify.phone_length_invalid', 'Sorry, mobile numbers with ' . $len . ' digits are not supported'];

+ 27 - 29
app/Http/Controllers/Game/SendCodeController.php

@@ -32,7 +32,7 @@ class SendCodeController
             return apiReturnFail(['web.user.phone_fail', 'Not correct phone number'], '', 422);
         }
 
-        $LocationCode = $request->country ?? env('COUNTRY_CODE',55);
+        $LocationCode = $request->country ?? env('COUNTRY_CODE',1);
 
         $user=$request->user();
         if($user){
@@ -69,34 +69,32 @@ class SendCodeController
             ->get();
 
         //默认
-        $SendCodeConfigType = rand(0,100)>50?3:1;
-
-        $SendCodeConfigType=1;
-        if ($SendCodeConfig->count() > 1) {
-
-            $redis_key=$phone."_".$Channel;
-            if (Redis::exists($redis_key)) {
-                $currentCodeType = (int)Redis::get($redis_key);
-                if($currentCodeType==100){
-                    //两个通道都发了,不能再发了
-//                    return apiReturnFail(['web.verify.no_wrong_later','Your number is incorrect or temporarily unavailable, please try again later']);
-                    $currentCodeType=1;
-                }
-                $SendCodeConfigType = $this->CodeType[$currentCodeType];
-//                Redis::set($redis_key, $this->CodeType[$currentCodeType]);
-                Redis::set($redis_key, $SendCodeConfigType);
-                Redis::expire($redis_key, 3600);
-                Log::info('补发验证码通道:'.$SendCodeConfigType);
-                Util::WriteLog('phone_error',$phone);
-            } else {
-                // 默认 codeType 1 天一泓短信
-                // 默认 codeType 3 plants
-                Redis::set($redis_key, $SendCodeConfigType);
-                Redis::expire($redis_key, 3600);
-            }
-        } else {
-            $SendCodeConfigType = (int)$SendCodeConfig->where('Status', 1)->first()->Type ?? 1;
-        }
+        $SendCodeConfigType=3;
+//        if ($SendCodeConfig->count() > 1) {
+//
+//            $redis_key=$phone."_".$Channel;
+//            if (Redis::exists($redis_key)) {
+//                $currentCodeType = (int)Redis::get($redis_key);
+//                if($currentCodeType==100){
+//                    //两个通道都发了,不能再发了
+////                    return apiReturnFail(['web.verify.no_wrong_later','Your number is incorrect or temporarily unavailable, please try again later']);
+//                    $currentCodeType=1;
+//                }
+//                $SendCodeConfigType = $this->CodeType[$currentCodeType];
+////                Redis::set($redis_key, $this->CodeType[$currentCodeType]);
+//                Redis::set($redis_key, $SendCodeConfigType);
+//                Redis::expire($redis_key, 3600);
+//                Log::info('补发验证码通道:'.$SendCodeConfigType);
+//                Util::WriteLog('phone_error',$phone);
+//            } else {
+//                // 默认 codeType 1 天一泓短信
+//                // 默认 codeType 3 plants
+//                Redis::set($redis_key, $SendCodeConfigType);
+//                Redis::expire($redis_key, 3600);
+//            }
+//        } else {
+//            $SendCodeConfigType = (int)$SendCodeConfig->where('Status', 1)->first()->Type ?? 1;
+//        }
 //        $SendCodeConfigType = 1;
 //        $redis->get(self::PHONE_SEND_LASTCONFIG_PREFIX . $phone);
         Log::info('发送验证码渠道:'.$SendCodeConfigType);

+ 3 - 3
config/InterfaceAPI.php

@@ -3,11 +3,11 @@ return [
     // 短信 -- 天一宏 -- 不卡
     'short_message' => [
         'gateway' => 'https://api.itniotech.com/sms/sendSms',
-        'appId' => '',
-        'appKey' => '',
+        'appId' => 'wLr2ZwLl',
+        'appKey' => 'F1dn5I21JhIKa1zDIIYTB3OIsA5pIaYw',
         'lengthNum' => 4,    // 短信长度
         'datetime' => time() + (3600 * 3), // 北京时间
-        'key' => '', // 秘钥
+        'key' => 'A67eeXBWIM66RVcqz2kzf2NO8wQRgXCV', // 秘钥
         'pbUrl'=>'https://api.itniotech.com/sms/postback/backfill',
         'host' => ['65.1.179.221','172.31.14.210']
     ],