From 1b4abd1ee37b6f12a9ac52f94cca6da20a0d9a09 Mon Sep 17 00:00:00 2001 From: cxdbz Date: Tue, 16 Oct 2018 21:34:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E5=87=BA=E5=B8=90=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/http/middleware/YanZheng.php | 3 --- application/index/controller/Index.php | 2 +- application/index/view/index/index.html | 2 +- application/login/controller/Index.php | 6 +++--- application/login/view/index/index.html | 2 +- config/cookie.php | 2 +- route/index.php | 3 ++- 7 files changed, 9 insertions(+), 11 deletions(-) diff --git a/application/http/middleware/YanZheng.php b/application/http/middleware/YanZheng.php index aa9824b3..ea3f590a 100644 --- a/application/http/middleware/YanZheng.php +++ b/application/http/middleware/YanZheng.php @@ -12,9 +12,6 @@ class YanZheng extends Controller { public function handle($request, \Closure $next) { - // 密码 - dump(session('username')); - dump(cookie('username')); // 验证用户在否登录 if(!session('?userid') && cookie('name') == null ) { diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php index e0734dbd..dc653679 100644 --- a/application/index/controller/Index.php +++ b/application/index/controller/Index.php @@ -77,7 +77,7 @@ class Index extends Base public function exit() { // 清除cookie - cookie(null, 'chengji_'); + cookie(null, 'think_'); // 清除session(当前作用域) session(null); diff --git a/application/index/view/index/index.html b/application/index/view/index/index.html index 73c59efb..889f52cf 100644 --- a/application/index/view/index/index.html +++ b/application/index/view/index/index.html @@ -55,7 +55,7 @@
  • 1
  • diff --git a/application/login/controller/Index.php b/application/login/controller/Index.php index ac1a7ec4..0913aacd 100644 --- a/application/login/controller/Index.php +++ b/application/login/controller/Index.php @@ -38,7 +38,7 @@ class Index extends Controller $result = $validate->check($data); $msg = $validate->getError(); if(!$result){ - $this->redirect('/notfound',[], 302, ['msg' => $msg]); + $this->redirect('/notfound',['msg' => $msg]); } // 重新计算密码 @@ -61,8 +61,8 @@ class Index extends Controller if( request()->post('online') == true ) { // 设置 - cookie('username', $userinfo->username); - cookie('password', $userinfo->password); + cookie('username', $userinfo->username ,259200); + cookie('password', $userinfo->password ,259200); } // 将本次信息上传到服务器上 diff --git a/application/login/view/index/index.html b/application/login/view/index/index.html index 331e50e6..83524aa5 100644 --- a/application/login/view/index/index.html +++ b/application/login/view/index/index.html @@ -49,7 +49,7 @@
    diff --git a/config/cookie.php b/config/cookie.php index 56589ccc..02f9935d 100644 --- a/config/cookie.php +++ b/config/cookie.php @@ -14,7 +14,7 @@ // +---------------------------------------------------------------------- return [ // cookie 名称前缀 - 'prefix' => 'chengji_', + 'prefix' => 'think_', // cookie 保存时间 'expire' => 259200, // cookie 保存路径 diff --git a/route/index.php b/route/index.php index 94932f3a..f2481252 100644 --- a/route/index.php +++ b/route/index.php @@ -10,4 +10,5 @@ // +---------------------------------------------------------------------- Route::rule('/','index/index/index'); //主页 -Route::rule('welcome','index/welcome'); //欢迎页 +Route::rule('welcome','index/index/welcome'); //欢迎页 +Route::rule('exit','index/index/exit'); // 退出