<?php

namespace addons\csmtable\library\xcore\xcore\utils;

use EasyWeChat\Factory;

/**
 * 基于easyweixin 5.x的公众号工具类
 */
class XcWeixinOaUtils
{
    public static function createApp($extern_config=[])
    {
        $config = [
            'app_id' => XcConfigUtils::config('cloginwxoaappid'),
            'secret' => XcConfigUtils::config('cloginwxoaappsecret'),
            'response_type' => 'array',
        ];

        $all_config = array_merge($config,$extern_config);
        $app = Factory::officialAccount($all_config);
        return $app;
    }

    public static function getAppid(){
        return XcConfigUtils::config('cloginwxoaappid');
    }
}
