shish 4 anni fa
parent
commit
e4cdcfb74f

+ 1 - 1
app-ghs/controllers/ApplyController.php

@@ -68,7 +68,7 @@ class ApplyController extends BaseController
     public function actionRegister()
     {
         //避免重复提交
-        util::checkRepeatCommit($this->adminId);
+        util::checkRepeatCommit($this->adminId,30);
 
         $post = Yii::$app->request->post();
         $post['adminId'] = $this->adminId;

+ 1 - 1
app-hd/controllers/ApplyController.php

@@ -70,7 +70,7 @@ class ApplyController extends BaseController
     public function actionRegister()
     {
         //避免重复提交
-        util::checkRepeatCommit($this->adminId);
+        util::checkRepeatCommit($this->adminId,30);
 
         $post = Yii::$app->request->post();
         $post['adminId'] = $this->adminId;

+ 2 - 2
common/components/util.php

@@ -393,7 +393,7 @@ class util
     }
 
     //检查是否有重复提交 shish 20211018
-    public static function checkRepeatCommit($adminId)
+    public static function checkRepeatCommit($adminId, $second = 10)
     {
         $ctl = Yii::$app->controller->id;
         $action = Yii::$app->controller->action->id;
@@ -402,7 +402,7 @@ class util
         if (!empty($has)) {
             util::fail('请稍候...');
         }
-        Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 30, 'has']);
+        Yii::$app->redis->executeCommand('SETEX', [$cacheKey, $second, 'has']);
     }
 
 }