From 579e58522c83dfc2fe54f3d0fc225ef12091b269 Mon Sep 17 00:00:00 2001
From: heyuntao <heyuntao@LAPTOP-MP4HD5NS>
Date: 星期六, 07 十月 2023 10:57:34 +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