config('customer.wechat_id'), 'secret' => config('customer.wechat_secret'), ]; $this->app = Factory::officialAccount($config); } public function share($request) { $type = true; if(env('APP_ENV') == 'production'){ $type =false; } $this->app->jssdk->setUrl($request['url']); return $this->app->jssdk->buildConfig(['updateAppMessageShareData', 'updateTimelineShareData'], $type); } }