// +---------------------------------------------------------------------- namespace app\services\work; use app\services\BaseServices; use crmeb\services\wechat\config\WorkConfig; use crmeb\services\wechat\contract\WorkAppConfigHandlerInterface; /** * 企业微信配置 * Class WorkConfigServices * @package app\services */ class WorkConfigServices extends BaseServices implements WorkAppConfigHandlerInterface { /** * 获取应用配置 * @param string $corpId * @param string $type * @return array */ public function getAppConfig(string $corpId, string $type): array { $config = []; switch ($type) { case WorkConfig::TYPE_USER: $config = [ 'secret' => sys_config('wechat_work_user_secret') ]; break; case WorkConfig::TYPE_ADDRESS: $config = [ 'secret' => sys_config('wechat_work_address_secret'), ]; break; case WorkConfig::TYPE_USER_APP: $config = [ 'agent_id' => sys_config('wechat_work_build_agent_id'), 'secret' => sys_config('wechat_work_build_secret'), ]; break; } return $config; } }