shish 4 ani în urmă
părinte
comite
3b45d30efc

+ 4 - 5
app-ghs/controllers/ApplyController.php

@@ -33,7 +33,8 @@ class ApplyController extends BaseController
         $rand = rand(11111, 99999);
         $minute = 10;
         sms::send($mobile . ',' . $rand . ',' . $minute, '注册验证码:{$var},{$var}分钟内有效');
-        $cacheKey = 'register_mobile_code_' . $mobile;
+        $ptStyle = Yii::$app->params['ptStyle'];
+        $cacheKey = 'register_mobile_code_' . $ptStyle . '_' . $mobile;
         Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 600, $rand]);
         util::complete();
     }
@@ -96,8 +97,8 @@ class ApplyController extends BaseController
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
         try {
-
-            $cacheKey = 'register_mobile_code_' . $mobile;
+            $ptStyle = Yii::$app->params['ptStyle'];
+            $cacheKey = 'register_mobile_code_' . $ptStyle . '_' . $mobile;
             $saveAuthCode = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
             if (empty($saveAuthCode)) {
                 util::fail('请填写验证码哦');
@@ -108,8 +109,6 @@ class ApplyController extends BaseController
             if ($saveAuthCode != $authCode) {
                 util::fail('验证码错误');
             }
-
-            $ptStyle = Yii::$app->params['ptStyle'];
             $name = $post['adminName'] ?? '';
             $miniOpenId = $post['miniOpenId'] ?? '';
             $adminInfo = ['name' => $name, 'mobile' => $mobile, 'style' => $ptStyle, 'miniOpenId' => $miniOpenId];

+ 5 - 3
app-hd/controllers/ApplyController.php

@@ -33,7 +33,8 @@ class ApplyController extends BaseController
         $rand = rand(11111, 99999);
         $minute = 10;
         sms::send($mobile . ',' . $rand . ',' . $minute, '注册验证码:{$var},{$var}分钟内有效');
-        $cacheKey = 'register_mobile_code_' . $mobile;
+        $ptStyle = Yii::$app->params['ptStyle'];
+        $cacheKey = 'register_mobile_code_' . $ptStyle . '_' . $mobile;
         Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 600, $rand]);
         util::complete();
     }
@@ -99,7 +100,8 @@ class ApplyController extends BaseController
             //避免重复提交
             util::checkRepeatCommit($mobile, 10);
 
-            $cacheKey = 'register_mobile_code_' . $mobile;
+            $ptStyle = Yii::$app->params['ptStyle'];
+            $cacheKey = 'register_mobile_code_' . $ptStyle . '_' . $mobile;
             $saveAuthCode = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
             if (empty($saveAuthCode)) {
                 util::fail('请填写验证码哦');
@@ -110,7 +112,7 @@ class ApplyController extends BaseController
             if ($saveAuthCode != $authCode) {
                 util::fail('验证码错误');
             }
-            $ptStyle = Yii::$app->params['ptStyle'];
+
             $name = $post['adminName'] ?? '';
             $miniOpenId = $post['miniOpenId'] ?? '';
             $adminInfo = ['name' => $name, 'mobile' => $mobile, 'style' => $ptStyle, 'miniOpenId' => $miniOpenId];