12345678910111213141516171819202122232425262728 |
- <?php
- namespace app\common\behavior;
- class Limit
- {
- public function run(&$request)
- {
- $file = sys_get_temp_dir() . "/cps_redis_error";
- if (is_file($file)) {
- if (intval(file_get_contents($file)) >= time()) {
- http_response_code(502);
- header("Content-Type: text/html;charset=utf-8");
- echo '<meta charset="utf-8">';
- echo '<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">';
- echo '<title>502 Sorry, HTTP ERROR~</title>';
- echo '502 Sorry, HTTP ERROR~';
- echo "<br><br><br>";
- echo '<a href="javascript:window.location.reload();">点我重试一次</a>';
- die();
- } else {
- @unlink($file);
- }
- }
- }
- }
|