diff --git a/application/api/controller/Index.php b/application/api/controller/Index.php index 619bbc1..beb34b3 100644 --- a/application/api/controller/Index.php +++ b/application/api/controller/Index.php @@ -777,6 +777,10 @@ class Index extends Api */ public function ClassificationOnTheLeftSideOfTheHomePage() { +// $user_id = $this->is_token($this->request->header()); + $user_id=$this->request->header(); + dump($user_id); + die; $class_a = Db::name('classa')->select(); foreach ($class_a as $k => $v) { $first_list[$k]['id']=$v['id']; diff --git a/application/common/controller/Api.php b/application/common/controller/Api.php index 6e96fdb..a0a5cf5 100644 --- a/application/common/controller/Api.php +++ b/application/common/controller/Api.php @@ -329,7 +329,7 @@ class Api */ protected function is_token($token) { - if (empty($token['Authorization'])) { + if (empty($token['authorization'])) { $this->error('请登录后在操作'); } $is_token = Db::name('user')->where(['token' => $token['token']])->find();