Prechádzať zdrojové kódy

增加随机ID方法

kevin 1 rok pred
rodič
commit
d2218c0d06

+ 2 - 0
frontendApi/config/params.php

@@ -21,6 +21,7 @@ return [
         'v1/shop/i-pay88',
         'v1/shop/re-query-payment',
         'v1/shop/upop-webhook',
+        'v1/site/random-id',
     ],
     'noCheckPermissionActions' => [
         'shop/logistics',
@@ -28,5 +29,6 @@ return [
         'shop/i-pay88',
         'shop/re-query-payment',
         'shop/upop-webhook',
+        'site/random-id',
     ],
 ];

+ 1 - 0
frontendApi/config/urlManagerRules.php

@@ -21,6 +21,7 @@ return [
             'GET captcha' => 'captcha',
             'GET send-notice' => 'send-notice',
             'GET send-notify' => 'send-notify',
+            'GET random-id' => 'random-id',
         ],
     ],
     [

+ 12 - 0
frontendApi/modules/v1/controllers/SiteController.php

@@ -307,4 +307,16 @@ class SiteController extends BaseController
 
         return static::notice('成功', 0);
     }
+
+    public function actionRandomId()
+    {
+        $max = \Yii::$app->request->get('cnt', 10);
+
+        $result = [];
+        for ($i = 1; $i <= $max; $i++) {
+            $result[] = PageSnowFake::instance()->generateId();
+        }
+
+        return static::notice($result);
+    }
 }