Browse Source

接口访问频繁的操作

lizhen_gitee 9 months ago
parent
commit
bd7cf3eec2

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

@@ -45,7 +45,7 @@ class Base extends Api
 
         $this->loadUniShopLang();
 
-        //$this->limitVisit();
+        $this->limitVisit();
     }
 
     /**

+ 1 - 0
addons/unishop/controller/Category.php

@@ -10,6 +10,7 @@ use think\Db;
 class Category extends Api
 {
 
+    protected $frequently = ['all','menu','inlist'];
     protected $noNeedLogin = ['all','menu','inlist'];
     protected $noNeedRight = ['*'];
 

+ 1 - 0
addons/unishop/controller/Product.php

@@ -16,6 +16,7 @@ use think\Exception;
 class Product extends Base
 {
     protected $noNeedLogin = ['detail', 'lists'];
+    protected $frequently = ['detail', 'lists'];
 
     /**
      * @ApiTitle    (产品详情)