Przeglądaj źródła

Merge branch 'master' of http://18.167.157.193:1026/guanli/ngds into feature/1540-theo-auto-mesure-up

theo 3 lat temu
rodzic
commit
7191a053da

+ 14 - 1
frontendApi/config/params.php

@@ -1,6 +1,19 @@
 <?php
 return [
     'adminEmail' => 'admin@example.com',
-    'noCheckTokenActions' => ['v1/oauth/login', 'v1/oauth/refresh-access-token', 'v1/oauth/refresh-refresh-token', 'v1/oauth/refresh-token', 'v1/site/days-diff', 'v1/site/page-data', 'v1/site/captcha', 'v1/oauth/is-login-verify','v1/oauth/login-by-backend', 'v1/oauth/no-login-modify-password', 'v1/site/doc', 'v1/site/config'],
+    'noCheckTokenActions' => [
+        'v1/oauth/login',
+        'v1/oauth/refresh-access-token',
+        'v1/oauth/refresh-refresh-token',
+        'v1/oauth/refresh-token',
+        'v1/site/days-diff',
+        'v1/site/page-data',
+        'v1/site/captcha',
+        'v1/oauth/is-login-verify',
+        'v1/oauth/login-by-backend',
+        'v1/oauth/no-login-modify-password',
+        'v1/site/doc',
+        'v1/site/config',
+        'v1/shop/verify-approach-order'],
     'noCheckPermissionActions' => [],
 ];

+ 1 - 1
frontendApi/config/urlManagerRules.php

@@ -77,7 +77,7 @@ return [
             'GET dec-order-export/<orderSn>' => 'dec-order-export',
             'POST sure-approach-order' => 'sure-approach-order',
             'POST delete-approach-order' => 'delete-approach-order',
-            'GET,POST verify-approach-order' => 'verify-approach-order',
+            'POST verify-approach-order' => 'verify-approach-order',
         ],
     ],
     [

+ 16 - 0
frontendApi/modules/v1/controllers/ShopController.php

@@ -11,6 +11,7 @@ namespace frontendApi\modules\v1\controllers;
 use Codeception\PHPUnit\ResultPrinter\HTML;
 use common\helpers\Date;
 use common\helpers\Form;
+use common\helpers\LoggerTool;
 use common\helpers\Tool;
 use common\helpers\user\Info;
 use common\models\ApproachOrder;
@@ -36,6 +37,21 @@ use Yii;
 class ShopController extends BaseController {
     public $modelClass = DecOrder::class;
 
+    protected $_method_not_check = [
+        'actionVerifyApproachOrder',
+        'verify-approach-order'
+    ];
+
+    public function beforeAction($action)
+    {
+        $currentAction = $action->id;
+        if (in_array($currentAction, $this->_method_not_check)) {
+            $action->controller->enableCsrfValidation = false;
+        }
+
+        return parent::beforeAction($action);
+    }
+
     /**
      * 商品列表
      * @return mixed