From 7e71450339d72ccbf0ecb61519ce3da4a9289cfa Mon Sep 17 00:00:00 2001 From: xiaoz Date: Wed, 13 Mar 2019 22:34:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9BBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/User.php | 4 +-- application/libraries/Basic.php | 8 +++-- application/views/user/multiple.php | 56 +---------------------------- application/views/user/page.php | 7 +++- static/embed.js | 4 +++ 5 files changed, 19 insertions(+), 60 deletions(-) diff --git a/application/controllers/User.php b/application/controllers/User.php index 8fee6a0..598ac91 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -68,9 +68,9 @@ } } public function logout(){ - echo '您已退出,将在5s后返回首页!'; + echo '您已退出,将在3s后返回首页!'; $this->clean_cookies(); - header("Refresh:5;url=/"); + header("Refresh:3;url=/"); exit; } //清除COOKIE diff --git a/application/libraries/Basic.php b/application/libraries/Basic.php index 040861a..6ba1b68 100644 --- a/application/libraries/Basic.php +++ b/application/libraries/Basic.php @@ -51,7 +51,10 @@ return false; } else{ - echo '权限不足!'; + echo "权限不足,请重新登录 。"; + //清除cookies + setcookie("user", '', time()-3600,"/"); + setcookie("token", '', time()-3600,"/"); exit; } } @@ -71,7 +74,7 @@ curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"); //伪造reffer - curl_setopt ($ch, CURLOPT_REFERER, $url); + curl_setopt ($curl, CURLOPT_REFERER, $url); curl_setopt($curl, CURLOPT_FAILONERROR, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); @@ -81,6 +84,7 @@ curl_setopt($curl , CURLOPT_TIMEOUT, 60); $html = curl_exec($curl); + curl_close($curl); //返回数据 return $html; diff --git a/application/views/user/multiple.php b/application/views/user/multiple.php index 2009897..e423711 100644 --- a/application/views/user/multiple.php +++ b/application/views/user/multiple.php @@ -49,58 +49,4 @@ - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/application/views/user/page.php b/application/views/user/page.php index 2dd63cb..849f657 100644 --- a/application/views/user/page.php +++ b/application/views/user/page.php @@ -6,7 +6,12 @@