新增频繁操作提示页面

master
chenzhi 4 years ago
parent ca99de9ac5
commit 3a7b06977f

@ -448,7 +448,9 @@ class BaseController extends HomeController
$count = Redis::incr($key); $count = Redis::incr($key);
if ($count > 60) { if ($count > 60) {
Log::write('user_access_limit:' . date('Y-m-d H:i:s') . ' ' . $key . '[' . $url . ']', 'INFO'); Log::write('user_access_limit:' . date('Y-m-d H:i:s') . ' ' . $key . '[' . $url . ']', 'INFO');
die('请求太频繁,请稍后再试!'); $this->assign("ttl",Redis::ttl($key));
$this->display("index/accessLimit");
die();
} }
} else { } else {
Redis::incr($key); Redis::incr($key);

@ -0,0 +1,176 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, minimal-ui">
<style>
* {
margin: 0;
padding: 0;
}
html,
body {
height: 100%;
}
body {
background-color: #EEF0F5;
}
body,
button {
font-family: arial, verdana, helvetica, 'PingFang SC', 'HanHei SC', 'STHeitiSC-Light', Microsoft Yahei, sans-serif;
font-size: 14px;
line-height: 24px;
color: #414a60;
-webkit-font-smoothing: antialiased;
}
a {
text-decoration: none;
}
#wrap {
position: relative;
min-height: 100%;
}
.btn {
width: 100px;
display: inline-block;
height: 40px;
line-height: 40px;
font-size: 16px;
text-align: center;
margin-right: 20px;
background-color: #fff;
border: 1px solid #2c3235;
vertical-align: middle;
cursor: pointer;
border-radius: 4px;
-webkit-appearance: none;
-webkit-box-sizing: border-box;
box-sizing: border-box;
transition: background-color .2s linear, box-shadow .2s linear;
outline: none;
user-select: none;
}
.btn:hover {
background-color: #3274d9;
color: #fff;
}
.error-content {
position: absolute;
width: 500px;
min-height: 260px;
top: 50%;
left: 50%;
margin-left: -250px;
margin-top: -300px;
margin-bottom: 0px;
}
.error-content h1 {
font-size: 30px;
line-height: 36px;
padding-top: 30px;
}
.error-content h3 {
padding: 20px 0 18px;
font-size: 18px;
font-weight: normal;
margin-top:20px;
}
.error-content h3.gray {
color: #9fa3b0;
}
.error-content p {
color: #9fa3b0;
max-width: 300px;
}
.error-content .btns {
padding-top: 30px;
}
#tips {
position: absolute;
top: 65%;
min-height: 30px;
width: 100%;
text-align: center;
color: #9fa3b0;
}
#footer {
position: absolute;
width: 100%;
bottom: 10px;
text-align: center;
color: #bec3d1;
}
@media (max-width: 760px) {
.error-content {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
margin: 0 auto;
width: auto;
background-position: center 30px;
background-size: 200px auto;
text-align: center;
padding-top: 150px;
}
.error-content h1 {
font-size: 24px;
}
.error-content h3 {
font-size: 15px;
padding: 10px 0 10px;
}
.btns {
white-space: nowrap;
}
#footer {
font-size: 12px;
}
}
#verifyMessage {
padding-left: 10px;
width: 470px;
}
</style>
</head>
<body>
<div id="wrap">
<div id="main">
<div class="error-content">
<div style="width: 500px;height: 300px;background: url(__IMG__/20170913/optionlimit.png) no-repeat 100%/ cover;"></div>
<h3 class="gray" id="verifyMessage">当前用户存在异常访问行为:【操作太频繁】,请等待{$ttl}s后重试</h3>
</div>
</div>
<div id="footer">
<p>© copyright 万盟天下游戏</p>
</div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Loading…
Cancel
Save