<?php

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

use EasyWeChat\Factory;

/**
 * 基于easyweixin 5.x的小程序工具类
 */
class XcWeixinMpUtils
{
    public static function createApp($extern_config=[])
    {
        $config = [
            'app_id' => XcConfigUtils::config('cloginwxmpappid'),
            'secret' => XcConfigUtils::config('cloginwxmpappsecret'),
            'response_type' => 'array',
        ];

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

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