|
|
@@ -31,12 +31,12 @@ class GiftCardQrCodeService
|
|
|
$app = Factory::miniProgram($config);
|
|
|
|
|
|
// 修正:使用正确的API方法
|
|
|
- $response = $app->app_code->getUnlimited($scene, [
|
|
|
- 'page' => $page,
|
|
|
- 'width' => 280,
|
|
|
- 'auto_color' => false,
|
|
|
- 'line_color' => ['r' => 0, 'g' => 0, 'b' => 0],
|
|
|
- ]);
|
|
|
+// $response = $app->app_code->getUnlimited($scene, [
|
|
|
+// 'page' => $page,
|
|
|
+// 'width' => 280,
|
|
|
+// 'auto_color' => false,
|
|
|
+// 'line_color' => ['r' => 0, 'g' => 0, 'b' => 0],
|
|
|
+// ]);
|
|
|
|
|
|
// 如果上面的方法不工作,尝试以下替代方案:
|
|
|
// 方案1:使用get方法
|
|
|
@@ -45,9 +45,9 @@ class GiftCardQrCodeService
|
|
|
// ]);
|
|
|
|
|
|
// 方案2:使用getQrCode方法
|
|
|
- // $response = $app->app_code->getQrCode($page . '?' . $scene, [
|
|
|
- // 'width' => 280,
|
|
|
- // ]);
|
|
|
+ $response = $app->app_code->getQrCode($page . '?' . $scene, [
|
|
|
+ 'width' => 280,
|
|
|
+ ]);
|
|
|
|
|
|
if (!($response instanceof \EasyWeChat\Kernel\Http\StreamResponse)) {
|
|
|
Log::error('生成小程序码失败', ['response' => $response]);
|