From 1056ba2d3f9966357cf28e3d714b77c58f7a7e0a Mon Sep 17 00:00:00 2001 From: zhaoxiang <756958008@qq.com> Date: Sun, 6 Nov 2016 16:09:41 +0800 Subject: [PATCH] =?UTF-8?q?modified=20=E4=BF=AE=E6=94=B9request=E7=9A=84?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/User.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/application/admin/controller/User.php b/application/admin/controller/User.php index 3a8a707..54ede15 100644 --- a/application/admin/controller/User.php +++ b/application/admin/controller/User.php @@ -9,7 +9,6 @@ namespace app\admin\controller; use app\admin\model\UserData; -use think\Request; class User extends Base { @@ -18,10 +17,9 @@ class User extends Base { * @return mixed|void */ public function login(){ - $request = Request::instance(); - if( $request->isPost() ){ - $username = $request->post('username'); - $password = $request->post('password'); + if( $this->request->isPost() ){ + $username = $this->request->post('username'); + $password = $this->request->post('password'); if( !$username || !$password ){ return $this->error('缺少关键数据!'); } @@ -36,8 +34,8 @@ class User extends Base { session('uid', $userInfo[$this->primaryKey]); cache($userInfo[$this->primaryKey], session_id(), config('online_time')); //获取跳转链接,做到从哪来到哪去 - if( $request->has('from', 'get') ){ - $url = $request->get('from'); + if( $this->request->has('from', 'get') ){ + $url = $this->request->get('from'); }else{ $url = url('Index/index'); }