|
|
@@ -392,4 +392,17 @@ class util
|
|
|
return $redis->del($key);
|
|
|
}
|
|
|
|
|
|
+ //检查是否有重复提交 shish 20211018
|
|
|
+ public static function checkRepeatCommit($adminId)
|
|
|
+ {
|
|
|
+ $ctl = Yii::$app->controller->id;
|
|
|
+ $action = Yii::$app->controller->action->id;
|
|
|
+ $cacheKey = "checkRepeatCommit_" . $ctl . "_" . $action . "_" . $adminId;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
|
|
|
+ if (!empty($has)) {
|
|
|
+ util::fail('请稍候...');
|
|
|
+ }
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 3, 'has']);
|
|
|
+ }
|
|
|
+
|
|
|
}
|