123456789101112131415161718192021222324252627 |
- <?php
- namespace App\Services;
- use EasyWeChat\Factory;
- class WechatService
- {
- public function __construct()
- {
- $config = [
- 'app_id' => config('customer.wechat_id'),
- 'secret' => config('customer.wechat_secret'),
- ];
- $this->app = Factory::officialAccount($config);
- }
- public function share()
- {
- $type = true;
- if(env('APP_ENV') == 'production'){
- $type =false;
- }
- return $this->app->jssdk->buildConfig(['updateAppMessageShareData', 'updateTimelineShareData'], $type);
- }
- }
|