From 754e426cf37961192e7a6189a81acb9b3410e376 Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期二, 08 八月 2023 16:58:42 +0800 Subject: [PATCH] no message --- application/common/controller/Api.php | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/application/common/controller/Api.php b/application/common/controller/Api.php index 6aee7d9..d0070a1 100644 --- a/application/common/controller/Api.php +++ b/application/common/controller/Api.php @@ -110,6 +110,7 @@ $token = $this->request->server('HTTP_TOKEN', $this->request->request('token', \think\Cookie::get('token'))); $path = str_replace('.', '/', $controllername) . '/' . $actionname; + $hasInit=false; // 璁剧疆褰撳墠璇锋眰鐨刄RI $this->auth->setRequestUri($path); // 妫�娴嬫槸鍚﹂渶瑕侀獙璇佺櫥褰� @@ -117,13 +118,18 @@ //鍒濆鍖� if(empty($token)) {//token涓虹┖锛屽垽鏂璼essionkey - $sessionkey= $this->request->server('HTTP_TOKEN', $this->request->request('dfgsessionkey', \think\Cookie::get('dfgsessionkey'))); + $sessionkey= $this->request->server('HTTP_DFGSESSIONKEY', $this->request->request('dfgsessionkey', \think\Cookie::get('dfgsessionkey'))); if(!empty($sessionkey)) {//鏍¢獙sessionkey - + $paramsArr=$this->request->post(false); + $this->auth->initSession($sessionkey,$paramsArr); + $hasInit=true; } } - $this->auth->init($token); + if(!$hasInit) + { + $this->auth->init($token); + } //妫�娴嬫槸鍚︾櫥褰� if (!$this->auth->isLogin()) { $this->error(__('Please login first'), [], 401); -- Gitblit v1.9.3