Quellcode durchsuchen

Merge branch 'iOIL' of 39.97.239.116:gyfl/xyzshop into iOIL

ayHaru vor 4 Jahren
Ursprung
Commit
c5131a6aa0
3 geänderte Dateien mit 15 neuen und 4 gelöschten Zeilen
  1. 9 3
      helper/fcgi_server.php
  2. 1 1
      mobile/signature.php
  3. 5 0
      test/TestRefill.php

+ 9 - 3
helper/fcgi_server.php

@@ -104,7 +104,6 @@ class fcgi_server
                 init_cookie($_SERVER['HTTP_COOKIE']);
                 $file = request_helper::script_file();
 
-                Log::record("member_id=" . session_helper::memberid(),Log::DEBUG);
                 if(file_exists($file))
                 {
                     if(defined('CROSS_DOAMIN') && CROSS_DOAMIN == true) {
@@ -120,7 +119,6 @@ class fcgi_server
                     }
                     else
                     {
-                        session::instance()->start();
                         if(!isset($_GET['act'])) {
                             $_GET['act'] = 'index';
                         }
@@ -133,6 +131,14 @@ class fcgi_server
                         if(!isset($_POST['op'])) {
                             $_POST['op'] = 'index';
                         }
+
+                        //部分控制器不需要使用session.
+                        $act = $_GET['act'];
+                        if($act != 'refill') {
+                            session::instance()->start();
+                            Log::record("member_id=" . session_helper::memberid(),Log::DEBUG);
+                        }
+
                         Base::mobile_control();
                     }
                 }
@@ -162,6 +168,6 @@ class fcgi_server
         }
 
         fcgi_fini();
-        Log::record('Waiting......',Log::DEBUG);
+        Log::record('Waiting quit......',Log::DEBUG);
     }
 }

+ 1 - 1
mobile/signature.php

@@ -10,7 +10,7 @@ $echostr = $_GET["echostr"];
 echo("{$echostr}");
 
 $token = 'stanleykinghelloworld';
-$tmpArr = array($token, $timestamp, $nonce);
+$tmpArr = [$token, $timestamp, $nonce];
 sort($tmpArr, SORT_STRING);
 $tmpStr = implode( $tmpArr );
 $tmpStr = sha1( $tmpStr );

+ 5 - 0
test/TestRefill.php

@@ -107,6 +107,11 @@ class TestRefill extends TestCase
 
     }
 
+    public function testRemoveSession()
+    {
+        $resp = http_request(BASE_SITE_URL . "/mobile/signature.php",[],'POST');
+    }
+
     public function testAddPhoe()
     {
         $params = ['mchid' => 10088,