Browse Source

小程序码

zhangxiaobin 1 year ago
parent
commit
ff09c7c01c
2 changed files with 6 additions and 5 deletions
  1. 3 5
      application/api/controller/company/User.php
  2. 3 0
      application/extra/param.php

+ 3 - 5
application/api/controller/company/User.php

@@ -183,12 +183,10 @@ class User extends Apic
             if (empty($company['mini_code'])) {
                 $client = new Client();
                 $tk = getAccessToken();
+                $miniCodeConfig = config('param.mini_code');
+                $miniCodeConfig['scene'] = 'shopId='.$companyId;
                 $res2 = $client->request('POST', 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token='.$tk, [
-                    'json' => [
-                        //'page' => 'pages/home/index',
-                        'env_version'=>'trial',
-                        'scene' => 'shopId='.$companyId,
-                    ]
+                    'json' => $miniCodeConfig,
                 ]);
                 $fileName = md5($companyId);
                 $fileUrl = '/uploads/company/'.$fileName.'.png';

+ 3 - 0
application/extra/param.php

@@ -22,4 +22,7 @@ return [
         'tMSenoMJundYGJHx6JyotRepbN8d80whfobs_EvS_lY',
     ],
     'pay_test' => 1,//支付测试  1=测试,0正常
+    'mini_code' => [
+        'env_version'=>'trial',//正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。
+    ],
 ];