Commit b140596c authored by zhoujun's avatar zhoujun

审核图片策略

parent 09081d0a
......@@ -34,8 +34,21 @@ class AdminController extends Controller
* @date 2021/06/02
* @author live
*/
public function getLogin()
public function getLogin(Request $request)
{
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}else {
$ip = $_SERVER['REMOTE_ADDR'];
}
$ips = explode(',',$ip);
if(!in_array($ips[0],['116.227.124.169','116.227.126.145'])){
abort(404);
exit();
}
if(Auth::check()) return redirect(route('checkImg'));
$data['ERROR'] = Session::get('error','');
return $this->view('admin.login',$data);
......@@ -48,6 +61,19 @@ class AdminController extends Controller
*/
public function getPostLogin(Request $request)
{
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}else {
$ip = $_SERVER['REMOTE_ADDR'];
}
$ips = explode(',',$ip);
if(!in_array($ips[0],['116.227.124.169','116.227.126.145'])){
exit('页面走丢了');
return false;
}
$postData = $request->all();
if( Auth::check()) return redirect(route('checkImg'));
if($request->isMethod('post'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment