Jelajahi Sumber

unishop base类优化

lizhen_gitee 10 bulan lalu
induk
melakukan
2a127869b1

+ 10 - 1
addons/unishop/controller/Base.php

@@ -30,13 +30,22 @@ class Base extends Api
      */
     protected $frequently = [];
 
-    public function _initialize()
+    /*public function _initialize()
     {
         parent::_initialize();
 
         $this->loadUniShopLang();
 
         $this->limitVisit();
+    }*/
+
+    public function __construct()
+    {
+        parent::__construct();
+
+        $this->loadUniShopLang();
+
+        $this->limitVisit();
     }
 
     /**

+ 1 - 1
addons/unishop/controller/Order.php

@@ -34,7 +34,7 @@ class Order extends Base
      * 允许频繁访问的接口
      * @var array
      */
-    protected $frequently = ['getorders','getOrders','detail'];
+    protected $frequently = ['getorders','getOrders','detail','refund_reason'];
 
     protected $noNeedLogin = ['count'];
 

+ 0 - 4
application/common/controller/Api.php

@@ -448,10 +448,6 @@ class Api
     }
 
     protected function request_log_update($log_result){
-        $actionname     = $this->request->action();
-        if(strtolower($actionname) == 'givegifttoyou'){
-            //return true;
-        }
 
         if ($this->logType === 1){
             if (strlen(json_encode($log_result['data'])) > 1000) {