// 时间
if (time() - cache($account . "_time") < 20) return '已锁定';
//检验帐号密码
$res = SystemAdmin::login($account, $pwd);
// 将用户名存入到缓存中
if (!cache($account)) {
cache($account, 1);
return '用户名或密码错误';
}
// 判断次数是否超过3次?
if (cache($account) < 3) {
cache($account, cache($account) + 1);
return '用户名或密码错误';
} else {
cache($account . "_time", time());
cache($account, 0);
return '超过三次,已锁定';
}
账号或密码输入错误3次,锁定5分钟不可再登录
猜你喜欢
转载自blog.csdn.net/zhouqi1427/article/details/114005749
今日推荐
周排行