$rawConfig['app_id'], 'secret' => $rawConfig['secret'], ]; if ($appID && $appID != $config['app_id']) { if (!isset($rawConfig['extend'])) { throw new InvalidArgumentException('请确认配置的微信小程序信息是否正确'); } foreach ($rawConfig['extend'] as $item) { if ($item['app_id'] == $appID) { $config = [ 'app_id' => $item['app_id'], 'secret' => $item['secret'], ]; break; } } } $config['use_stable_access_token'] = true; parent::__construct($config); $this->setCache(Cache::instance()); } }