فهرست منبع

师傅端-产品小程序码

whitefang 1 سال پیش
والد
کامیت
4877e9f7ad
1فایلهای تغییر یافته به همراه20 افزوده شده و 15 حذف شده
  1. 20 15
      app/workerapi/logic/GoodsCategoryLogic.php

+ 20 - 15
app/workerapi/logic/GoodsCategoryLogic.php

@@ -18,21 +18,26 @@ class GoodsCategoryLogic extends BaseLogic
      */
     public static function getQRCode()
     {
-        try {
-            $config = WeChatConfigService::getMnpConfig();
-            $app = new Application($config);
-            $response = $app->getClient()->postJson('/wxa/getwxacodeunlimit', [
-                'scene' => 'type=2&id=19',
-                'page' => '/pages/good/good',
-                'width' => 430,
-                'check_path' => false,
-                'env_vesion' => 'trial'
-            ]);
-            dd($response);
-        } catch (\Throwable $e) {
-            // 失败
-            echo $e->getMessage();
-        }
+        $config = WeChatConfigService::getMnpConfig();
+
+        $app = new Application($config);
+        $response = $app->getClient()->postJson('/wxa/getwxacodeunlimit', [
+            'scene' => '123',
+            'page' => 'pages/index/index',
+            'width' => 430,
+            'check_path' => false,
+        ]);
+        $path = $response->saveAs('/tmp/wxacode-123.png');
+        dd($response);
+
+        $response = $app->getClient()->postJson('/wxa/getwxacodeunlimit', [
+            'scene' => 'type=2&id=19',
+            'page' => '/pages/good/good',
+            'width' => 430,
+            'check_path' => false,
+            'env_vesion' => 'trial'
+        ]);
+        dd($response);
 
     }